Skip to content

Commit

Permalink
Merge pull request #15284 from webpack/feature/__webpack_module__
Browse files Browse the repository at this point in the history
change __webpack_module_id__ to __webpack_module__.id
  • Loading branch information
sokra committed Jan 31, 2022
2 parents 612de99 + d7a87ab commit 04039ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 04039ca

Please sign in to comment.