<!-- ⚡️ katchow! We 💛 issues. Please - do not - remove this template. Please - do not - skip or remove parts of this template. Or your issue may be closed. 👉🏽 Need help or tech support? Please don't open an issue! Head to https://gitter.im/rollup/rollup or https://stackoverflow.com/questions/tagged/rollupjs ❤️ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate --> ### Feature Use Case I have a source file with an export: `export function a() {…}` I also have a `rollup.config.js` which has two outputs: ``` output: [ { file: "dist/bundle.min.js", format: "es", name: "bundle", sourcemap: true, }, { file: "dist/bundle.iife.min.js", format: "iife", name: "b", sourcemap: true, }, ], ``` Using the `es` version, I can use `import {a} from 'bundle';`, this works fine. Using the `iife` version, I can only access `a` as `b.a`, which is undesirable. ### Feature Proposal I propose a solution to address this and make it possible to have `a` available as a global variable instead of a property of the bundle. This feature has been requested in #494, but the (hacky) solution doesn't work anymore. Possible solutions to indicate this in the config are: 1. Just omit `output.name`. 2. Set `output.name` to the empty string "" 3. Set `output.name` to "window", similar to the solution in issue #494.
Feature Use Case
I have a source file with an export:
export function a() {…}I also have a
rollup.config.jswhich has two outputs:Using the
esversion, I can useimport {a} from 'bundle';, this works fine.Using the
iifeversion, I can only accessaasb.a, which is undesirable.Feature Proposal
I propose a solution to address this and make it possible to have
aavailable as a global variable instead of a property of the bundle.This feature has been requested in #494, but the (hacky) solution doesn't work anymore.
Possible solutions to indicate this in the config are:
output.name.output.nameto the empty string ""output.nameto "window", similar to the solution in issue export to multiple globals without moduleName (IIFE) #494.