I need help to run a chain of commands in npm
scripts when building a js
application.
Right now Im running this line:
"scripts": {
"build-js": "browserify src/app/main.js --debug | exorcist dist/app.js.map > dist/app.js",
}
That browserifies and extracts sourcemaps. But I would also like to minify with uglifyjs2
.
How to I pipe uglifyjs to get a minified source with external sourcemaps?
uglifyify
can help you:
browserify -t uglifyify src/app/main.js --debug | exorcist dist/app.js.map > dist/app.js
You can do this:
"browserify": "browserify -e scripts/index.js -d -t browserify-shim | exorcist scripts/bundle.map | uglifyjs -cm > scripts/bundle.js"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With