Closed ghost closed 7 years ago
Hey, @jhabdas — I think this is Gulp-specific. I can't find anything in the docs or changelog that suggests otherwise. Did you run into this in a non-Gulp setup?
Yes, bare setup. https://github.com/jhabdas/fetch-inject
@jhabdas I think this has changed. I just pulled Rollup v0.41.6 and used the following config:
export default {
entry: 'src/index.js',
dest: 'build/js/bundle.js',
format: 'iife',
sourceMap: 'inline',
}
This successfully bundled two small modules. The docs do say that moduleName
is required for UMD format, though.
I'm going to close this, but let me know if there's something else you've found that could affect IIFE generation.
FYI - https://github.com/rollup/rollup/issues/1157#issuecomment-268284551. TL;DR, if your module exports, then you need to give it a name. Thanks again for your attention and help. Love your website and great article!
@jhabdas This is really helpful — thanks for digging up that comment and clarifying!
rollup version 0.41.4
🚨 You must supply options.moduleName for IIFE bundles
Example module name: http://rollupjs.org/#using-rollup-with-gulp. Without it will not transpile.