babel-standalone icon indicating copy to clipboard operation
babel-standalone copied to clipboard

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

Open Daniel15 opened this issue 9 years ago • 4 comments

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.

Daniel15 avatar Nov 29 '16 06:11 Daniel15

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

hzoo avatar Nov 30 '16 00:11 hzoo

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

Daniel15 avatar Nov 30 '16 00:11 Daniel15

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

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

Thanks

nhuttrung avatar Aug 17 '17 16:08 nhuttrung

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

Daniel15 avatar Aug 18 '17 00:08 Daniel15