File tree Expand file tree Collapse file tree
test/configCases/externals/externals-in-commons-chunk Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ it ( "should not move externals into the commons chunk" , function ( ) {
2+ require ( "should" ) ;
3+ var fs = require ( "fs" ) ;
4+ var source1 = fs . readFileSync ( __dirname + "/main.js" , "utf-8" ) ;
5+ var source2 = fs . readFileSync ( __dirname + "/other.js" , "utf-8" ) ;
6+ var source3 = fs . readFileSync ( __dirname + "/common.js" , "utf-8" ) ;
7+ source1 . should . containEql ( "1+" + ( 1 + 1 ) ) ;
8+ source1 . should . containEql ( "3+" + ( 2 + 2 ) ) ;
9+ source2 . should . containEql ( "1+" + ( 1 + 1 ) ) ;
10+ source2 . should . containEql ( "5+" + ( 3 + 3 ) ) ;
11+ source3 . should . not . containEql ( "1+" + ( 1 + 1 ) ) ;
12+ source3 . should . not . containEql ( "3+" + ( 2 + 2 ) ) ;
13+ source3 . should . not . containEql ( "5+" + ( 3 + 3 ) ) ;
14+
15+ require ( "external" ) ;
16+ require ( "external2" ) ;
17+ } ) ;
Original file line number Diff line number Diff line change 1+ require ( "external" ) ;
2+ require ( "external3" ) ;
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ findBundle : function ( i , options ) {
3+ return [
4+ "./common.js" ,
5+ "./main.js"
6+ ]
7+ }
8+ } ;
Original file line number Diff line number Diff line change 1+ var webpack = require ( "../../../../" )
2+ module . exports = {
3+ entry : {
4+ main : "./index" ,
5+ other : "./other"
6+ } ,
7+ externals : {
8+ fs : "commonjs fs" ,
9+ external : "1+2" ,
10+ external2 : "3+4" ,
11+ external3 : "5+6"
12+ } ,
13+ target : "web" ,
14+ output : {
15+ filename : "[name].js"
16+ } ,
17+ node : {
18+ __dirname : false ,
19+ __filename : false
20+ } ,
21+ plugins : [
22+ new webpack . optimize . CommonsChunkPlugin ( {
23+ name : "common"
24+ } )
25+ ]
26+ } ;
You can’t perform that action at this time.
0 commit comments