webpack native module

This commit is contained in:
Jan Prochazka
2021-01-16 18:55:10 +01:00
parent 943f9c1c24
commit c5e75dfe3e
5 changed files with 76 additions and 14 deletions

View File

@@ -8,24 +8,27 @@ var config = {
app: './index.js',
},
target: 'node',
node: {
__dirname: false,
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
libraryTarget: 'commonjs2',
},
// optimization: {
// minimize: false,
// },
// optimization: {
// minimize: false,
// },
// module: {
// rules: [
// {
// test: /\.js$/,
// exclude: /node_modules/
// },
// ],
// },
module: {
rules: [
{
test: /\.node$/,
use: 'node-loader',
},
],
},
plugins: [
new webpack.IgnorePlugin({
checkResource(resource) {