File tree Expand file tree Collapse file tree
test/configCases/externals/module-externals-in-async-chunk Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11it ( "Should place externals into its own chunks when externalsType is module" , function ( done ) {
22 var fs = require ( "fs" ) ;
3- var path = require ( "path" ) ;
4- var source = fs . readFileSync ( __filename , "utf-8" ) ;
5- var source2 = fs . readFileSync (
6- path . resolve ( __dirname , "./async.mjs" ) ,
7- "utf-8"
8- ) ;
93
10- // external
11- expect ( source2 ) . toMatch ( / i m p o r t ( .* ) f r o m \s * [ " ' ] f s [ " ' ] \s * / ) ;
12- // external2
13- expect ( source2 ) . toMatch ( / i m p o r t ( .* ) f r o m \s * [ " ' ] n o d e : f s [ " ' ] \s * / ) ;
14- // external3
15- expect ( source ) . toMatch ( / i m p o r t \( \s * [ " ' ] f s [ " ' ] \s * \) / ) ;
16- expect ( source ) . not . toMatch ( / i m p o r t ( .* ) f r o m \s * [ " ' ] f s [ " ' ] \s * / ) ;
17- expect ( source ) . not . toMatch ( / i m p o r t ( .* ) f r o m \s * [ " ' ] n o d e : f s [ " ' ] \s * / ) ;
4+ expect ( __webpack_modules__ [ "external" ] ) . toBeUndefined ( ) ;
5+ expect ( __webpack_modules__ [ "external2" ] ) . toBeUndefined ( ) ;
6+ expect ( __webpack_modules__ [ "external3" ] ) . toBeDefined ( ) ;
187
198 import ( /* webpackChunkName: 'async' */ "./chunk" ) . then ( ( ns ) => {
9+ expect ( __webpack_modules__ [ "external" ] ) . toBeDefined ( ) ;
10+ expect ( __webpack_modules__ [ "external2" ] ) . toBeDefined ( ) ;
2011 expect ( ns . readFileSync ) . toBe ( fs . readFileSync ) ;
2112 expect ( ns . readFile ) . toBe ( fs . readFile ) ;
2213
Original file line number Diff line number Diff line change @@ -11,5 +11,9 @@ module.exports = {
1111 experiments : {
1212 outputModule : true
1313 } ,
14- output : { chunkFilename : "[name].mjs" }
14+ output : { chunkFilename : "[name].mjs" } ,
15+ optimization : {
16+ moduleIds : "named" ,
17+ concatenateModules : false
18+ }
1519} ;
You can’t perform that action at this time.
0 commit comments