forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle several resources in ContextModule
- Loading branch information
Showing
11 changed files
with
177 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/configCases/resolve/issue-11335-context-module/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import a from "app/widgets/a"; | ||
import b from "app/widgets/b"; | ||
import c from "app/widgets/c"; | ||
|
||
|
||
it("static imports order", () => { | ||
expect(a).toBe("main/widgets/a"); | ||
expect(b).toBe("main/widgets/b"); | ||
expect(c).toBe("foo/widgets/c"); | ||
}); | ||
|
||
const load = id => import(/* webpackMode: "eager" */ `app/widgets/${id}?query#hash`); | ||
|
||
it("dynamic imports order", async () => { | ||
expect((await load("a")).default).toBe("main/widgets/a"); | ||
expect((await load("b")).default).toBe("main/widgets/b"); | ||
expect((await load("c")).default).toBe("foo/widgets/c"); | ||
}); |
1 change: 1 addition & 0 deletions
1
test/configCases/resolve/issue-11335-context-module/src/foo/widgets/b.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "foo/widgets/b"; |
1 change: 1 addition & 0 deletions
1
test/configCases/resolve/issue-11335-context-module/src/foo/widgets/c.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "foo/widgets/c"; |
1 change: 1 addition & 0 deletions
1
test/configCases/resolve/issue-11335-context-module/src/main/widgets/a.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "main/widgets/a"; |
1 change: 1 addition & 0 deletions
1
test/configCases/resolve/issue-11335-context-module/src/main/widgets/b.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "main/widgets/b"; |
10 changes: 10 additions & 0 deletions
10
test/configCases/resolve/issue-11335-context-module/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const path = require("path"); | ||
|
||
/** @type {import("../../../../").Configuration} */ | ||
module.exports = { | ||
resolve: { | ||
alias: { | ||
app: [path.join(__dirname, "src/main"), path.join(__dirname, "src/foo")] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters