Closed jpkli closed 3 years ago
Hi, thanks for the feedback. I believe this is a node-loader
issue, since it should automatically resolve all the dependencies (like ncc
does for example). But nevertheless, my proposed workaround is to use the copy-webpack-plugin
:
const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
target: 'node',
node: {
__dirname: false,
},
plugins: [
new CopyPlugin({
patterns: [
{ from: "**/*.dylib", to: "[name].[ext]" },
],
}),
],
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
},
],
},
};
I'm going to add this to the readme.
Thank you! We're already using the copy-plugin as a workaround for now.
Thank you for sharing this awesome work!
I tried to use node-duckdb, but encountered the following error when using with webpack 5.x and node-loader on Mac OS:
I have to manually copy the "libduckdb.dylib" from the node_modules/node-duckdb/build/Release folder to my build folder to work around this error. It would be great if this can be fixed. Thanks again!