From 4186098a2c21f48a02791883ac11de386b01bf80 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:05:43 +0900 Subject: [PATCH] docs(commonjs): `output.exports` recommendation also applies to IIFE --- packages/commonjs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/commonjs/README.md b/packages/commonjs/README.md index be35a5bed..5d44a2f41 100644 --- a/packages/commonjs/README.md +++ b/packages/commonjs/README.md @@ -408,7 +408,7 @@ export default { }; ``` -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. +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. ## Using with @rollup/plugin-node-resolve