Skip to content

Commit

Permalink
warn.code for missing output.name of IIFE bundle that has export (#3372)
Browse files Browse the repository at this point in the history
* warn.code for missing output.name of IIFE bundle that has export

* Make warning code slightly more descriptive

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
  • Loading branch information
3 people committed Mar 6, 2020
1 parent eeda078 commit 97b8c40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/finalisers/iife.ts
Expand Up @@ -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.`
});
}
Expand Down
1 change: 1 addition & 0 deletions test/function/samples/warn-missing-iife-name/_config.js
Expand Up @@ -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.'
}
Expand Down

0 comments on commit 97b8c40

Please sign in to comment.