Skip to content

fix(nmf): Fix exports for var injection to include free glob export or args#3971

Merged
sokra merged 3 commits into
masterfrom
bugfix/fix_available_vars_in_fmtp
Jan 16, 2017
Merged

fix(nmf): Fix exports for var injection to include free glob export or args#3971
sokra merged 3 commits into
masterfrom
bugfix/fix_available_vars_in_fmtp

Conversation

@TheLarkInn
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?
Bugfix.

Did you add tests for your changes?
N/A

If relevant, link to documentation update:
N/A

Summary
Patches issue discovered in RC5. exportArguments should be tried first before "exports".

Does this PR introduce a breaking change?
No

Other information
Fixes #3917

@TheLarkInn
Copy link
Copy Markdown
Member Author

Also fixed #3974

Comment thread lib/NormalModule.js Outdated
varStartCode += "/* WEBPACK VAR INJECTION */(function(" + varNames.join(", ") + ") {";
// exports === this in the topLevelBlock, but exports do compress better...
varEndCode = (topLevelBlock === block ? "}.call(exports, " : "}.call(this, ") +
varEndCode = (topLevelBlock === block ? "}.call(module.exportsArgument || 'exports', " : "}.call(this, ") +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' string? Is that right? Sorry if that's intentional.

@sokra sokra merged commit e9bdb05 into master Jan 16, 2017
@sokra sokra deleted the bugfix/fix_available_vars_in_fmtp branch January 16, 2017 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.2.0-rc.4's es6 modules' "module" usage detection seems to be broken

3 participants