babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

Integration with preset-env - compile target option #428

Open boopathi opened 7 years ago

boopathi commented 7 years ago

Prior art:

https://github.com/babel/babili/pull/387#issuecomment-274878437

Some optimizations which involve creating new functions or replacing or adding new functions or variables could be simplified to use the newer JS syntax (arrow functions, object methods, shorthand properties, default params, etc...). But we need an option to specify the target language version.

With babel-preset-env data it is possible to specify the target browsers, nodejs versions and use a particular feature - say arrow-functions, or spread-operator based on the computed values.

nitin42 commented 7 years ago

I think this relies on enhancing the cli. Because the new cli would take presets options and some other babel options !?? Using the compat-table data would not be possible then !