Skip to content

Commit

Permalink
[chores] Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
totallynotvaishnav committed Oct 27, 2022
1 parent 927b234 commit 4196875
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "jest",
"dev": "webpack serve --open --hot --mode development",
"dev": "webpack serve --open --mode development",
"start": "yarn dev",
"build": "webpack --progress --mode production",
"coverage": "jest --coverage",
Expand Down
12 changes: 7 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const templates = examples.map((example) => {
template: path.resolve(__dirname, `public/example_templates/${example}`),
});
});
const minimizer = [
new TerserPlugin({
extractComments: false,
}),
];

module.exports = (env, argv) => ({
entry: "./src/js/netjsongraph.js",
Expand All @@ -24,11 +29,7 @@ module.exports = (env, argv) => ({
devtool: argv.mode === "development" ? "eval-source-map" : "source-map",
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
minimizer: argv.mode === "production" ? minimizer : [],
},
module: {
rules: [
Expand All @@ -44,6 +45,7 @@ module.exports = (env, argv) => ({
},
historyApiFallback: true,
open: ["./index.html"],
hot: true,
},
plugins: [...templates],
performance: {
Expand Down

0 comments on commit 4196875

Please sign in to comment.