reactjs - Get the list of compiled modules? Exclude React from bundle? -


how list of compiled modules bundled browserify + babelify? i've set simple bundling process gulp.

i noticed bundle becomes big. don't have lot of 'useful' code. libraries have following on page: react, react-router, validator , eventemitter, immutable. bundle 1.5mbs. map file separate. there way minimize size?

i tried exclude react with:

bundlestream.external(['jquery', 'react']); 

i saw jquery excluded , size smaller now. still see react modules in output.

update

so, problem used few react components added via npm. 1 of pointing 'react' , other 'react/addons'. figured manually going through code. not sure tool me that. strip had add both browserify bundle:

bundlestream.external(['jquery', 'react', 'react/addons']); 

one thing mention though goal load libraries cdn , use theirs globals in code. i've written simple browserify transform function explained here change require('react') or import react 'react' lines global window.react, didn't work out require calls inside react components npm. half of bundle contained window.react , other still require('react') lines.

to fix piped bundle after babelify transform replacestream so:

.pipe(replacestream('require("react")', 'window.react')) 

these links may you.


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -