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 { ServiceWorkerPlugin } = require("service-worker-webpack");
const banner = `
const base = {
output: {
- filename: "js/server.js",
- publicPath: "/",
hashFunction: "xxhash64",
},
resolve: {
...base,
entry: "./src/server/index.tsx",
output: {
+ ...base.output,
filename: "js/server.js",
+ publicPath: "/",
},
target: "node",
externals: [nodeExternals(), "inferno-helmet"],
...base,
entry: "./src/client/index.tsx",
output: {
+ ...base.output,
filename: "js/client.js",
publicPath: `/static/${env.COMMIT_HASH}/`,
},
// name: "server",
// };
+ const RunNodeWebpackPlugin = require("run-node-webpack-plugin");
serverConfig.plugins.push(
new RunNodeWebpackPlugin({ runOnlyInWatchMode: true })
);