const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const nodeExternals = require('webpack-node-externals');
const CopyPlugin = require('copy-webpack-plugin');
+const RunNodeWebpackPlugin = require('run-node-webpack-plugin');
const { merge } = require('lodash');
const banner = `
],
};
-const createServerConfig = (env, mode) => {
+const createServerConfig = (_env, mode) => {
const config = merge({}, base, {
mode,
entry: './src/server/index.tsx',
type: 'filesystem',
name: 'server',
};
+
+ config.plugins.push(
+ new RunNodeWebpackPlugin({
+ runOnlyInWatchMode: true,
+ })
+ );
}
return config;
};
-const createClientConfig = (env, mode) => {
+const createClientConfig = (_env, mode) => {
const config = merge({}, base, {
mode,
entry: './src/client/index.tsx',