diff --git a/src/finalisers/iife.ts b/src/finalisers/iife.ts index 706e2f62429..5f5aec49a33 100644 --- a/src/finalisers/iife.ts +++ b/src/finalisers/iife.ts @@ -49,6 +49,7 @@ export default function iife( if (hasExports && !name) { warn({ + code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.` }); } diff --git a/test/function/samples/warn-missing-iife-name/_config.js b/test/function/samples/warn-missing-iife-name/_config.js index 2326bd1f959..07c9331fb90 100644 --- a/test/function/samples/warn-missing-iife-name/_config.js +++ b/test/function/samples/warn-missing-iife-name/_config.js @@ -3,6 +3,7 @@ module.exports = { options: { output: { format: 'iife' } }, warnings: [ { + code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', message: 'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.' }