Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

javascript - How to get minified output with browserify?

Just started to use browserify, but I cannot find documentation for how to get it spilling out minified output.

So I am looking something like:

$> browserify main.js > bundle.js --minified
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Pipe it through uglifyjs:

 browserify main.js | uglifyjs > bundle.js

You can install it using npm like so:

 npm install -g uglify-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...