Skip to content

Commit

Permalink
feat: add hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderdrummer committed Dec 21, 2020
1 parent 3e80d0c commit 7a6145c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion apps/the-app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const nrwlConfig = require("@nrwl/react/plugins/webpack.js");
const webpack = require("webpack");

const { NX_ENV } = process.env;
const isDevelopment = NX_ENV === "development";

module.exports = (config, _) => {
nrwlConfig(config);

return config;
return {
...config,
plugins: [
...config.plugins,
isDevelopment && new webpack.HotModuleReplacementPlugin(),
].filter(Boolean),
devServer: {
...config.devServer,
hot: true,
},
};
};

0 comments on commit 7a6145c

Please sign in to comment.