babel / babel-standalone

:video_game: Now located in the Babel repo! Standalone build of Babel for use in non-Node.js environments, including browsers.
https://github.com/babel/babel/tree/master/packages/babel-standalone
MIT License
819 stars 121 forks source link

Add a lighter build with no presets bundled (build them separately) #70

Open Daniel15 opened 7 years ago

Daniel15 commented 7 years ago

Someone might want to use babel-standalone only for JSX transformation (for example), and not want to use any of the other Babel stuff. For this use-case, bundling every standard plugin and preset with babel-standalone is overkill. Instead, there could be a babel-standalone core JS file that only contains the core of Babel, and a preset-react file that contains just the React preset.

Investigate how much space is saved by building Babel with no plugins, and whether it's actually worth it. Perhaps most of the space is taken by the core of Babel, which would mean this is actually not worth doing.

hzoo commented 7 years ago

Removing stuff from babel-core is it's own issue 😄

Daniel15 commented 7 years ago

@zoo babel-core is still lighter than babel-core + all presets though, right?

nhuttrung commented 7 years ago

I have same requirement: just core of Babel and preset-react.

How to customize package.json and/or index.js file?

Thanks

Daniel15 commented 7 years ago

@nhuttrung You could build your own version of babel-standalone that does not include any of the plugins or presets.