Skip to content

Commit 3efaf75

Browse files
authored
docs(commonjs): output.exports recommendation also applies to IIFE (#1810)
1 parent 75b9ca1 commit 3efaf75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/commonjs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export default {
408408
};
409409
```
410410

411-
When bundling to CommonJS, i.e `output.format === 'cjs'`, make sure that you do not set `output.exports` to `'named'`. The default value of `'auto'` will usually work, but you can also set it explicitly to `'default'`. That makes sure that Rollup assigns the default export that was generated for your CommonJS entry point to `module.exports`, and semantics do not change.
411+
When bundling to CommonJS or IIFE, i.e `output.format === 'cjs'` / `output.format === 'iife'`, make sure that you do not set `output.exports` to `'named'`. The default value of `'auto'` will usually work, but you can also set it explicitly to `'default'`. That makes sure that Rollup assigns the default export that was generated for your CommonJS entry point to `module.exports`, and semantics do not change.
412412

413413
## Using with @rollup/plugin-node-resolve
414414

0 commit comments

Comments
 (0)