mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
26 lines
773 B
JavaScript
26 lines
773 B
JavaScript
const nodeExternals = require('webpack-node-externals');
|
|
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');
|
|
|
|
module.exports = function (options, webpack) {
|
|
return {
|
|
...options,
|
|
entry: ['webpack/hot/poll?100', options.entry],
|
|
externals: [
|
|
nodeExternals({
|
|
allowlist: ['webpack/hot/poll?100'],
|
|
}),
|
|
],
|
|
output: {
|
|
filename: 'main.cjs',
|
|
},
|
|
plugins: [
|
|
...options.plugins,
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.WatchIgnorePlugin({
|
|
paths: [/\.js$/, /\.d\.ts$/],
|
|
}),
|
|
new RunScriptWebpackPlugin({ name: 'main.cjs', autoRestart: false }),
|
|
],
|
|
};
|
|
};
|