Fixed analyzer

This commit is contained in:
2021-08-20 21:21:18 +01:00
parent 9c863f309f
commit f415a7ece2
3 changed files with 122 additions and 122 deletions
+1
View File
@@ -109,6 +109,7 @@ public/*.js
public/*.css public/*.css
public/*.map public/*.map
public/*.gz public/*.gz
public/*.txt
letsencrypt/ letsencrypt/
mysql/ mysql/
+1 -1
View File
@@ -11,7 +11,7 @@
"dev": "concurrently npm:watch:server npm:watch:client", "dev": "concurrently npm:watch:server npm:watch:client",
"watch:server": "nodemon ./* --ext js,jsx,json --ignore 'node_modules/*'", "watch:server": "nodemon ./* --ext js,jsx,json --ignore 'node_modules/*'",
"watch:client": "webpack serve --env=development --config webpack.config.js", "watch:client": "webpack serve --env=development --config webpack.config.js",
"analyzer": "webpack --env=production --analyzer --config webpack.config.js" "analyze": "webpack --env=production --env=analyze --config webpack.config.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
+2 -3
View File
@@ -9,8 +9,7 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const path = require('path'); const path = require('path');
//the exported config function //the exported config function
module.exports = ({ production, analyzer }) => { module.exports = ({ production, analyze }) => {
return { return {
mode: production ? "production" : "development", mode: production ? "production" : "development",
entry: path.resolve(__dirname, 'client', 'client.jsx'), entry: path.resolve(__dirname, 'client', 'client.jsx'),
@@ -80,7 +79,7 @@ module.exports = ({ production, analyzer }) => {
minRatio: 0.8 minRatio: 0.8
}), }),
new BundleAnalyzerPlugin({ new BundleAnalyzerPlugin({
analyzerMode: analyzer ? 'server' : 'disabled' analyzerMode: analyze ? 'server' : 'disabled'
}) })
], ],
devServer: { devServer: {