nolanlawson / optimize-js

Optimize a JS file for faster parsing (UNMAINTAINED)
https://nolanlawson.github.io/optimize-js
Apache License 2.0
3.75k stars 104 forks source link

make a babel-plugin ? #16

Open p2227 opened 8 years ago

p2227 commented 8 years ago

a babal-plugin can parse more es6 code and can be more easy to integrate with gulp/webpack.

vigneshshanmugam commented 8 years ago

webpack - https://github.com/vigneshshanmugam/optimize-js-plugin gulp - https://github.com/prateekbh/gulp-optimize-js

austinkelleher commented 8 years ago

Lasso-js - https://github.com/austinkelleher/lasso-optimize-iife

nkt commented 8 years ago

I've just seen this project and tried to implement this as babel plugin. Unfortunately this functionality should be implemented in babel-generator instead of plugin. How babel works: code -> AST ( -> plugins) -> code. If you want to change AST -> code behaviour, you should add option to babel-generator, which transform AST into code and create plugin, which enables this option. Babel is not so much modular as we thought 😞

p2227 commented 8 years ago

maybe use it indepent and use the babel-transform in the core because of this

vigneshshanmugam commented 8 years ago

Babel will address this pretty soon, @nolanlawson I think you can close this issue :)

Check here - https://github.com/babel/babel/issues/4615 and this https://github.com/babel/babel/pull/4621