From 6c80fdff86413017c4f7ab93ea88cc74d934c15a Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Wed, 29 Jun 2022 00:58:37 +0200 Subject: [PATCH] postbuild and clean script webpack config compiles all matching rules and html-webpack-plugin into /dist output. Use postbuild to move file out from dist into public directory. clean tries to remove build files in /dist and index.html from postbuild. --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 47a30c5..af2ddd0 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,16 @@ "private": true, "scripts": { "dev": "cross-env NODE_ENV=development webpack server", - "build": "cross-env NODE_ENV=production webpack-cli build --progress -c webpack.config.js", + "build": "cross-env NODE_ENV=production webpack-cli build --progress", + "postbuild": "cp public/dist/index.html public/index.html", + "clean": "rm -r public/dist 2> /dev/null; rm public/index.html 2> /dev/null", "start": "node server.js", "docs": "documentation build src/api.js -f html -o docs/api && documentation build src/api.js -f md -o docs/api.md" }, "dependencies": { + "chart.js": "^2.9.2", "connect-history-api-fallback": "1.6.0", + "cross-env": "6.0.0", "express": "4.17.3", "vue": "2.6.14", "vue-axios": "2.1.5", @@ -24,8 +28,6 @@ "@babel/preset-env": "7.16.11", "@babel/runtime": "7.17.2", "babel-loader": "8.2.3", - "chart.js": "^2.9.2", - "cross-env": "6.0.0", "css-loader": "6.7.0", "documentation": "^11.0.0", "file-loader": "6.2.0",