Skip to content

Commit

Permalink
php-wasm/build: Explicitly list the external dependencies
Browse files Browse the repository at this point in the history
The esbuild.js config must export the config, not run the build.
This PR ensures that's the case and also that all the dependencies
are explicitly listed – unfortunately relying on the
esbuild-node-externals didn't solve the issue.
  • Loading branch information
adamziel committed Jul 8, 2024
1 parent f788ef3 commit 290de16
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/php-wasm/node/esbuild.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const esbuild = require('esbuild');
const { nodeExternalsPlugin } = require('esbuild-node-externals');

esbuild.build({
module.exports = {
entryPoints: [
'packages/php-wasm/node/src/index.ts',
'packages/php-wasm/node/src/noop.ts',
],
plugins: [nodeExternalsPlugin()],
supported: {
'dynamic-import': false,
},
Expand All @@ -21,10 +19,10 @@ esbuild.build({
},
bundle: true,
tsconfig: 'packages/php-wasm/node/tsconfig.json',
external: ['@php-wasm/*', '@wp-playground/*'],
external: ['@php-wasm/*', '@wp-playground/*', 'ws'],
loader: {
'.php': 'text',
'.ini': 'file',
'.wasm': 'file',
},
});
};

0 comments on commit 290de16

Please sign in to comment.