2020-03-14 08:54:34 +00:00
|
|
|
var webpack = require('webpack');
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
context: __dirname + '/src',
|
|
|
|
|
|
|
|
entry: {
|
|
|
|
app: './index.js',
|
|
|
|
},
|
|
|
|
target: 'node',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2020-05-16 06:23:10 +00:00
|
|
|
filename: 'bundle.js',
|
2020-06-09 18:54:14 +00:00
|
|
|
libraryTarget: 'commonjs2',
|
2020-03-14 08:54:34 +00:00
|
|
|
},
|
2020-05-16 06:23:10 +00:00
|
|
|
|
2020-11-26 14:42:50 +00:00
|
|
|
// optimization: {
|
|
|
|
// minimize: false,
|
|
|
|
// },
|
2020-06-09 18:54:14 +00:00
|
|
|
|
2020-05-16 06:23:10 +00:00
|
|
|
// module: {
|
|
|
|
// rules: [
|
|
|
|
// {
|
|
|
|
// test: /\.js$/,
|
|
|
|
// exclude: /node_modules/
|
|
|
|
// },
|
|
|
|
// ],
|
|
|
|
// },
|
2020-03-14 08:54:34 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.IgnorePlugin({
|
|
|
|
checkResource(resource) {
|
2020-11-26 14:42:50 +00:00
|
|
|
const lazyImports = ['uws'];
|
2020-03-14 08:54:34 +00:00
|
|
|
if (!lazyImports.includes(resource)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
require.resolve(resource);
|
|
|
|
} catch (err) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = config;
|