Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8654 from mc-zone/fix/8626
Fix: Add missed __webpack_require__.e while importing exist module with context
- Loading branch information
Showing
6 changed files
with
88 additions
and
40 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
1 change: 1 addition & 0 deletions
1
test/cases/chunks/import-context-exist-chunk/dir-initial-with-fake-map/initialModule.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 "initialModuleDefault"; |
1 change: 1 addition & 0 deletions
1
test/cases/chunks/import-context-exist-chunk/dir-initial-with-fake-map/initialModule2.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 @@ | ||
exports.default = "other"; |
1 change: 1 addition & 0 deletions
1
test/cases/chunks/import-context-exist-chunk/dir-initial/initialModule.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 "initialModuleDefault"; |
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,17 @@ | ||
it("should resolve when import existed chunk (#8626)", function(done) { | ||
require.context("./dir-initial/"); | ||
const fileName = "initialModule"; | ||
import(`./dir-initial/${fileName}`).then(({default:m}) => { | ||
expect(m).toBe("initialModuleDefault"); | ||
done(); | ||
}).catch(done); | ||
}); | ||
|
||
it("should resolve when import existed chunk with fake maps", function(done) { | ||
require.context("./dir-initial-with-fake-map/"); | ||
const fileName = "initialModule"; | ||
import(`./dir-initial-with-fake-map/${fileName}`).then(({default:m}) => { | ||
expect(m).toBe("initialModuleDefault"); | ||
done(); | ||
}).catch(done); | ||
}); |