3 ms·
I love it. It works great. Use it with https://github.com/rollup/rollup-babel https://github.com/rollup/rollup-babel for a complete es6 build.
by tshannon 11y ago
I love it. It works great. Use it with https://github.com/rollup/rollup-babel https://github.com/rollup/rollup-babel for a complete es6 build.
- ludbb 11y agoSo many things are next generation in JS that I can't tell what next generation means for JS anymore. For this package, does it mean I can't use today? I say that because typical packages do not declare jsnext:main yet, so you need to pass them as a list of external packages to rollup. It seems rollup won't produce an actual bundle when externals are used, is there any documentation about this? Taking react 0.14 as an example, rollup doesn't accept JSX so it doesn't work there either. Instead, you have to use a package that combines it with babel: rollup-babel (so now we are using a next generation next generation package). But running rollupbabel --external=react,react-dom --format=cjs --output=bundle.js -- index.jsx does not result in a bundle.js that bundles React. Is this too old for rollup?
- skrebbel 11y agoIn all honesty, the fact that babel isn't just a "rollup plugin" of sorts, and requires all kinds of custom code and a custom command line tool, makes me a bit wary of rollup. This is JavaScript land, things move too fast to not have modularity. Babel is going to be horribly outdated and replaced by some other next big thing tomorrow. Or maybe I want to write part of my codebase in PureScript instead. Will I need a "rollupbabelpurescript" concoction? Or am I completely missing the point here?
- tobr 11y agoI've been using Rollup and Babel together as they are, and it works fine. I haven't tried rollup-babel, but as I understand it, it mostly speeds up the build process.
- tshannon 11y agoWell they are actually separate modules, and if you look at rollup-babel you'll see the main reason it exists is to speed up builds. > Using Rollup then using Babel slows down development, because Babel is much quicker dealing with small files than large bundles. But using Babel then Rollup often means you include helpers (e.g. classCallCheck) multiple times. They are two separate modules that you can plug into whatever build tool you want separately. But even if they weren't modular, is it that big of a deal? In my opinion what build tools I use means a lot less than where I'm investing my time in what I learn, and all of these JS tools are building to the ES6 standard. The idea being, that hopefully someday in the http2 + es6 future we won't need all these build tools, but that shouldn't stop us from building experience on them now.