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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change __webpack_module_id__ to __webpack_module__.id #15284

Merged
merged 1 commit into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/APIPlugin.js
Expand Up @@ -203,10 +203,10 @@ class APIPlugin {
);

parser.hooks.expression
.for("__webpack_module_id__")
.for("__webpack_module__.id")
.tap("APIPlugin", expr => {
parser.state.module.buildInfo.moduleConcatenationBailout =
"__webpack_module_id__";
"__webpack_module__.id";
const dep = new ConstDependency(
parser.state.module.moduleArgument + ".id",
expr.range,
Expand Down
2 changes: 1 addition & 1 deletion test/cases/parsing/api/id.js
@@ -1 +1 @@
export default __webpack_module_id__;
export default __webpack_module__.id;
4 changes: 2 additions & 2 deletions test/cases/parsing/api/index.js
Expand Up @@ -2,9 +2,9 @@ import id from "./id";
import mod from "./module";
import modType from "./typeof-module";

it("should support __webpack_module_id__", () => {
it("should support __webpack_module__.id", () => {
expect(typeof id).toMatch(/^(string|number)$/);
expect(id).not.toBe(__webpack_module_id__);
expect(id).not.toBe(__webpack_module__.id);
});

it("should support __webpack_module__", () => {
Expand Down