aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/build.mjs
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-01-16 17:27:10 -0300
committerSebastian <sebasjm@gmail.com>2024-01-16 17:27:10 -0300
commit87765a4023e33d9502cf55ad2592dabf262ddc69 (patch)
tree68875bf4163c112af76f4370133fe6399b9a5936 /packages/web-util/build.mjs
parentafb91f0dc06294d9a1fdb30c6821eaeed71ae427 (diff)
load .node as files
Diffstat (limited to 'packages/web-util/build.mjs')
-rwxr-xr-xpackages/web-util/build.mjs7
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],
};
/**