add a source map inline to the end of the bundle
{
"main": "./js/entry.js",
"browser": {
"jquery": "./js/vendor/jquery.js"
},
"browserify-shim": {
"jquery": "$",
"three": "global:THREE"
},
"browserify": {
"transform": [ "browserify-shim" ]
},
"dependencies": {
"browserify-shim": "~3.2.0"
}
}
jquery
from the a js file the user maintains. I'd rather just use the browserified module and install and maintain it via npm install jquery
...
"jquery-ui": {
"depends": [
"jquery:jQuery"
]
},
...
b.pipeline
or b.pipeline.get('wrap')
? See: https://github.com/zoubin/factor-vinylify/pull/1#discussion_r63813785
require('net')
to return something particular after bundling. There is documentation that alludes to this being possible, but I honestly can't understand what incantation to use. I'd greatly appreciate any hints. Thanks.
React
whenever require('react')
is called?
module.exports = React
or something?
browserify-shim: { 'foo': 'global:Foo' }
browserify-shim: { 'mod': { depends: "foo" }}
Hi, I am working on a pretty simple project using React with babel and browserify. I am struggling to get proper minification/uglification working.
I already tried using minifyify and uglifyify. But there are still a lot of line breaks in the final file and overall the result seems still to large.(~300-400kb)
When using minifyify and then apply to uglifyjs2 to the output the file size goes down to ~200kb.
But it feels pretty redundant and does not work with watchify.
So I guess my question is: When using babel/browserify/watchify via cli, what's the best and simplest way to do minification?
NODE_ENV=production browserify src/main.js -t babelify -g envify -v -p bundle-collapser/plugin -p [minifyify --no-map --uglify [ --compress [ --dead_code ] --mangle ] ] | uglifyjs -m -e -c dead_code,screw-ie8,warnings=false > build/bundle.js
But passing all the uglify options twice feels wrong.
I would like it to look more like:
watchify src/main.js -t babelify -g envify -p uglify -o build/bundle.js -v