Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable ProvidePlugin for javascript/esm (fixes #7032) #8250

Merged
merged 3 commits into from Nov 5, 2018

Conversation

@aladdin-add
Copy link
Contributor

@aladdin-add aladdin-add commented Oct 22, 2018

#7032

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
updated a test case.

Does this PR introduce a breaking change?
not sure, I guess no. 馃槃

What needs to be documented once your changes are merged?

Copy link
Member

@sokra sokra left a comment

add a test case

.tap("ProvidePlugin", handler);

// Disable ProvidePlugin for javascript/esm, see https://github.com/webpack/webpack/issues/7032
// normalModuleFactory.hooks.parser

This comment has been minimized.

@sokra

sokra Oct 22, 2018
Member

remove the commented code, leave only a note why it's not enabled

@webpack-bot
Copy link
Contributor

@webpack-bot webpack-bot commented Oct 22, 2018

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)
@sokra sokra closed this Oct 23, 2018
@sokra sokra reopened this Oct 23, 2018
Copy link
Member

@sokra sokra left a comment

Tests missing

@aladdin-add aladdin-add changed the title fix: disable ProvidePlugin for javascript/esm (fixes #7032) wip: fix: disable ProvidePlugin for javascript/esm (fixes #7032) Oct 24, 2018
@aladdin-add aladdin-add force-pushed the aladdin-add:patch-3 branch from 22ac09a to 6672eee Oct 28, 2018
@webpack-bot
Copy link
Contributor

@webpack-bot webpack-bot commented Oct 28, 2018

@aladdin-add Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@aladdin-add
Copy link
Contributor Author

@aladdin-add aladdin-add commented Oct 28, 2018

@sokra I updated the test case in test/configCases/plugins/provide-plugin, added a '.mjs' in it.
please let me know if need something more.

@aladdin-add aladdin-add changed the title wip: fix: disable ProvidePlugin for javascript/esm (fixes #7032) fix: disable ProvidePlugin for javascript/esm (fixes #7032) Oct 28, 2018
@@ -10,7 +10,8 @@ module.exports = {
es2015_name: ["./harmony", "default"],
es2015_alias: ["./harmony", "alias"],
es2015_year: ["./harmony", "year"],
"this.aaa": "./aaa"
"this.aaa": "./aaa",
esm: "./fff.mjs"

This comment has been minimized.

@sokra

sokra Oct 30, 2018
Member

change this to esm: "fail"

import fff.mjs from index.js.

Use esm in fff.mjs. It should not be replaced. i. e.

export function() {
  return esm;
}

Currently you are not testing your change.

Signed-off-by: weiran.zsd <weiran.zsd@alibaba-inc.com>
@aladdin-add aladdin-add force-pushed the aladdin-add:patch-3 branch from 119188d to f61b485 Oct 31, 2018
@webpack-bot
Copy link
Contributor

@webpack-bot webpack-bot commented Oct 31, 2018

Thank you for your pull request! The most important CI builds succeeded, we鈥檒l review the pull request soon.

Co-Authored-By: Aladdin-ADD <weiran.zsd@outlook.com>
@sokra
sokra approved these changes Nov 5, 2018
@sokra sokra merged commit 355590e into webpack:master Nov 5, 2018
13 of 14 checks passed
13 of 14 checks passed
@codecov
codecov/project/integration 91.53% (-0.01%) compared to 8be0485
Details
@codecov
codecov/changes/basic No unexpected coverage changes found.
Details
@codecov
codecov/changes/integration No unexpected coverage changes found.
Details
@codecov
codecov/changes/unit No unexpected coverage changes found.
Details
@codecov
codecov/patch/basic Coverage not affected when comparing 8be0485...770edef
Details
@codecov
codecov/patch/integration Coverage not affected when comparing 8be0485...770edef
Details
@codecov
codecov/patch/unit Coverage not affected when comparing 8be0485...770edef
Details
@codecov
codecov/project/basic 100% remains the same compared to 8be0485
Details
@codecov
codecov/project/unit 100% (target 0%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
security/snyk - package.json (sokra) No manifest changes detected
@azure-pipelines
webpack.webpack Build #20181101.2 succeeded
Details
@sokra
Copy link
Member

@sokra sokra commented Nov 5, 2018

Thanks

@aladdin-add aladdin-add deleted the aladdin-add:patch-3 branch Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants