diff options
Diffstat (limited to 'packages/web-util/build.mjs')
-rwxr-xr-x | packages/web-util/build.mjs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/web-util/build.mjs b/packages/web-util/build.mjs index 1dffe96e4..efcf750bf 100755 --- a/packages/web-util/build.mjs +++ b/packages/web-util/build.mjs @@ -56,6 +56,8 @@ function git_hash() { * * Reference: * https://github.com/evanw/esbuild/issues/1051#issuecomment-806325487 + * + * kept as reference, need to be tested on MacOs */ const nativeNodeModulesPlugin = { name: 'native-node-modules', @@ -63,7 +65,7 @@ const nativeNodeModulesPlugin = { // If a ".node" file is imported within a module in the "file" namespace, resolve // it to an absolute path and put it into the "node-file" virtual namespace. build.onResolve({ filter: /\.node$/, namespace: 'file' }, args => ({ - path: path.resolve(args.path, { paths: [args.resolveDir] }), + path: require.resolve(args.path, { paths: [args.resolveDir] }), namespace: 'node-file', })) @@ -101,6 +103,7 @@ const buildConfigBase = { loader: { ".key": "text", ".crt": "text", + ".node": "file", ".html": "text", ".svg": "dataurl", }, @@ -109,7 +112,7 @@ const buildConfigBase = { __VERSION__: `"${_package.version}"`, __GIT_HASH__: `"${GIT_HASH}"`, }, - plugins: [nativeNodeModulesPlugin], + //plugins: [nativeNodeModulesPlugin], }; /** |