File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
test/cases/chunks/import-context-exist-chunk Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,14 @@ module.exports = class MainTemplate extends Tapable {
250
250
} else if (
251
251
chunk . hasModuleInGraph ( m =>
252
252
m . blocks . some ( b => b . chunkGroup && b . chunkGroup . chunks . length > 0 )
253
- )
253
+ ) ||
254
+ chunk
255
+ . getModules ( )
256
+ . some ( m =>
257
+ m . dependencies . some (
258
+ dep => dep . type && dep . type . startsWith ( "import()" )
259
+ )
260
+ )
254
261
) {
255
262
// There async blocks in the graph, so we need to add an empty requireEnsure
256
263
// function anyway. This can happen with multiple entrypoints.
Original file line number Diff line number Diff line change
1
+ export default "initialModuleDefault" ;
Original file line number Diff line number Diff line change
1
+ it ( "should resolve when import existed chunk (#8626)" , function ( done ) {
2
+ require . context ( "./dir-initial/" ) ;
3
+ const fileName = "initialModule" ;
4
+ import ( `./dir-initial/${ fileName } ` ) . then ( ( { default :m } ) => {
5
+ expect ( m ) . toBe ( "initialModuleDefault" ) ;
6
+ done ( ) ;
7
+ } ) . catch ( done ) ;
8
+ } ) ;
You can’t perform that action at this time.
0 commit comments