Cleanup when build finishes

This commit is contained in:
Igor Scheller 2021-08-17 14:46:42 +02:00
parent f201b2f1c8
commit c8901610bd
3 changed files with 244 additions and 332 deletions

View File

@ -6,8 +6,7 @@
"author": "https://github.com/engelsystem/engelsystem/contributors", "author": "https://github.com/engelsystem/engelsystem/contributors",
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"scripts": { "scripts": {
"build": "(export NODE_ENV=production && yarn build:clean && yarn build:webpack)", "build": "NODE_ENV=production yarn build:webpack",
"build:clean": "rimraf public/assets",
"build:webpack": "webpack", "build:webpack": "webpack",
"build:watch": "webpack --watch" "build:watch": "webpack --watch"
}, },
@ -36,7 +35,6 @@
"mini-css-extract-plugin": "^1.6.0", "mini-css-extract-plugin": "^1.6.0",
"postcss": "^8.2.8", "postcss": "^8.2.8",
"postcss-loader": "^5.2.0", "postcss-loader": "^5.2.0",
"rimraf": "^3.0.2",
"sass": "^1.35.1", "sass": "^1.35.1",
"sass-loader": "^12.0.0", "sass-loader": "^12.0.0",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",

View File

@ -47,6 +47,7 @@ module.exports = {
path: path.resolve('public/assets'), path: path.resolve('public/assets'),
filename: '[name].js', filename: '[name].js',
publicPath: '', publicPath: '',
clean: true,
}, },
optimization: { optimization: {
minimizer: __DEV__ ? [] : [new CssMinimizerPlugin(), new TerserPlugin()], minimizer: __DEV__ ? [] : [new CssMinimizerPlugin(), new TerserPlugin()],

571
yarn.lock

File diff suppressed because it is too large Load Diff