Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different output file size #64

Open
nickleefly opened this issue May 15, 2017 · 1 comment
Open

different output file size #64

nickleefly opened this issue May 15, 2017 · 1 comment

Comments

@nickleefly
Copy link

nickleefly commented May 15, 2017

Is there anything I'm doing wrong?

The output from below is 343K

browserify -t [ babelify --presets [ es2015 react ] ]  src/index.js \
-g [ envify --NODE_ENV production ] \
-g uglifyify -p bundle-collapser/plugin \
| uglifyjs -cm > public/build/app.js

is smaller than the one below is439K
build.js

var browserify = require('browserify')
var envify = require('envify/custom')

browserify('src/index.js')
  .transform('babelify', {presets: ['es2015', 'react']})
  .transform(envify({NODE_ENV: 'production'}))
  .transform({
    global: true,
    mangle: true,
    sourcemap: false,
    compress: {
      sequences: true,
      dead_code: true,
      booleans: true
    }
  }, 'uglifyify')
  .plugin(require('bundle-collapser/plugin'))
  .bundle()
  .pipe(process.stdout)

then node build.js | uglifyjs -cm > public/build/app.js

@casr
Copy link
Contributor

casr commented Dec 2, 2017

Maybe give #62 a go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants