Open jhg opened 3 years ago
Looking in the code of this repository I see this only load but don't copy native files, is that the expected behaviour and then the issue is in https://github.com/vercel/webpack-asset-relocator-loader or https://github.com/marshallofsound/webpack-asset-relocator-loader loader?
I think yes, our logic is simple https://github.com/webpack-contrib/node-loader/blob/master/src/index.js#L25
Expected Behavior
Copy the index.*.node file to webpack_output directory and maybe it is good idea rename that from index (name in some native modules) to other to avoid collision
Actual Behavior
Code
How Do We Reproduce?
Download the zip and the readme file has instructions to build and reproduce it:
example-issue-node-loader.zip
The native dependency is built first (using NAPI-rs) and it put the
index.*.node
in the package directory, inpackage.json
files include*.node
. The dependency is in the otherpackage.json
as afile:
dependency, and can find the*.js
file but do nothing about the native module file.Additional information
I realize now about the
.node
file is not copied insidenode_modules
subdirectory even it is inpackage.json
files
property. Maybe because it is defined asfile:
dependency instead of a gzip.Another try
Packing using
yarn pack
and using that in thefile:
path the.node
file is innode_modules
but the error is same.