I do build my app with rollup so everything ends up bundled in an index.js at my project root.
When node-libpng tries to resolve the path to the the node bindings (const qualifiedName = path.resolve(__dirname, "..", baseName);, __dirname is the name of my project root folder and node-libpng looks for the file on level up and generates an error:
bundles frontend/src/viewer/flyxc.ts → frontend/static/js...
/usr/local/google/home/berchet/code/flyxc/run/index.js:53560
throw new Error(`Unable to find native addon file "${fileName.qualifiedName}".`);
^
Error: Unable to find native addon file "/usr/local/google/home/berchet/code/flyxc/node-libpng-linux-x64-64.node".
It would be great to add an option to override path.resolve(__dirname, "..").
What I would do it then copy the .node files to my project root and override the folder ?
I do build my app with rollup so everything ends up bundled in an
index.js
at my project root.When node-libpng tries to resolve the path to the the node bindings (
const qualifiedName = path.resolve(__dirname, "..", baseName);
,__dirname
is the name of my project root folder and node-libpng looks for the file on level up and generates an error:It would be great to add an option to override
path.resolve(__dirname, "..")
.What I would do it then copy the
.node
files to my project root and override the folder ?Does that make sense ?