Skip to content

Commit

Permalink
[fix] remove builtin modules warning for adapter-node (#7031)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Sep 26, 2022
1 parent 1798dad commit fb96215
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-dingos-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-node': patch
---

Disable builtin modules warning
2 changes: 1 addition & 1 deletion packages/adapter-netlify/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const config = {
format: 'esm'
}
],
plugins: [nodeResolve(), commonjs(), json()],
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()],
external: (id) => id === '0SERVER' || id.startsWith('node:'),
preserveEntrySignatures: 'exports-only'
};
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function (opts = {}) {
manifest: `${tmp}/manifest.js`
},
external: [...Object.keys(pkg.dependencies || {})],
plugins: [nodeResolve(), commonjs(), json()]
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()]
});

await bundle.write({
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default [
file: 'files/index.js',
format: 'esm'
},
plugins: [nodeResolve(), commonjs(), json()],
plugins: [nodeResolve({ preferBuiltins: true }), commonjs(), json()],
external: ['ENV', 'HANDLER', ...builtinModules]
},
{
Expand Down

0 comments on commit fb96215

Please sign in to comment.