Closed curran closed 5 years ago
Nevermind - I just discovered a way to use JSX only with Rollup (which is what I need), from https://rollupjs.org/guide/en/#acorninjectplugins
import jsx from 'acorn-jsx';
export default {
// … other options …
acornInjectPlugins: [
jsx()
]
};
Reopening as I tried the acornInjectPlugins
approach, and realized that it just outputs the JSX, it doesn't transpile it.
I forked Bublé and removed all the non-JSX transforms: https://github.com/datavis-tech/buble-jsx-only
Minified & gzipped size comparisons:
Probably could be optimized further, but this is quite satisfying.
Thanks for taking on this!
I have a use case where I only need the JSX feature of Bublé, and I'm using it in the browser.
The issue I have is that all the unused logic for varous ES6 transpilation features is included in the bundle (my app bundle, which includes Bublé as part of it).
Is there any way to tree-shake Bublé itself so that only the JSX-related logic is included?