You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2020. It is now read-only.
The current build sequence for a typical webpack project is transpile -> bundle -> minify. As babili doesn't traverse through Objects and its properties (yet), there will not be much optimizations on the bundler generated code (modules[moduleId].call()) other than mangling and whitespace/comments removal. The pipeline can be transformed to (transpile + minify) -> bundle - if the bundler already produces mangled and has an option to output minified (just the syntax and comments) code. But, we could already do this now -
transpile + minify (mangle=false)
bundle - remove dead code module level (tree-shaking?)
// stage 1{
loader: 'babel-loader'
presets: ['es2016','react',['babili',{// <- options not yet supported (https://github.com/babel/babili/pull/162)mangle: false// this will be performed on the entire bundle.deadcode: false// not tested which is better for deadcode - stage1 or 3 - just an idea}]]}// stage 2bundle-webpack// stage 3newBabiliWebpackPlugin({mangle: true,// <- option not yet supporteddeadcode: true,// <- option not yet supported[everythingelse]: false// <- just a notationcomments: false,});// or babel.transform(bundledcode,{minified: true,// syntaxcompact: true,comments: false,plugins: ["mangle","deadcode"]})
The current build sequence for a typical webpack project is
transpile -> bundle -> minify. As babili doesn't traverse through Objects and its properties (yet), there will not be much optimizations on the bundler generated code(modules[moduleId].call())other than mangling and whitespace/comments removal. The pipeline can be transformed to(transpile + minify) -> bundle- if the bundler already produces mangled and has an option to output minified (just the syntax and comments) code. But, we could already do this now -