build: optimise production builds, automate creating zip files

This commit is contained in:
David Ralph
2021-06-22 21:07:56 +01:00
parent 50353c9e49
commit 5d3418a8af
3 changed files with 47 additions and 28 deletions

View File

@@ -48,13 +48,15 @@
"webpack": "^5.39.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^5.8.0"
"webpack-merge": "^5.8.0",
"zip-file-webpack-plugin": "^1.2.0"
},
"scripts": {
"start": "webpack serve --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"chrome": "cp manifest/chrome.json build/manifest.json",
"firefox": "cp manifest/firefox.json build/manifest.json"
"build:chrome": "webpack --config webpack.prod.js --env=type=chrome",
"build:firefox": "webpack --config webpack.prod.js --env=type=firefox",
"postinstall": "node -e \"if (require('fs').existsSync('node_modules/.cache/webpack')) require('fs').rmSync('node_modules/.cache/webpack', { recursive: true })\""
},
"browserslist": {
"production": [