[Vuejs]-VueJS: How to minify a file in /public

1๐Ÿ‘

I found a good solution for this finally after enough digging.
In the package.json "scripts" section:

"app-build": "vue-cli-service build --no-clean ",
"script-build": "minify public/js/thing.js --out-file public/js/thing.min.js",
"build": "npm run script-build && npm run app-build",

These resources helped:
Minify script in Webpack: https://stackoverflow.com/a/55579911
Combine webpack commands: https://stackoverflow.com/a/39172660

0๐Ÿ‘

You can use this web site. https://www.minifier.org/ and download it or use this one https://www.toptal.com/developers/javascript-minifier , it has apis and you can make easily a request

Leave a comment