File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55var nextIdent = 0 ;
66
77function CommonsChunkPlugin ( options ) {
8- if ( arguments . length > 1 )
9- throw new Error ( "CommonsChunkPlugin only takes one argument (pass an options object)" ) ;
8+ if ( arguments . length > 1 ) {
9+ throw new Error ( "Deprecation notice: CommonsChunkPlugin now only takes a single argument. Either an options " +
10+ "object *or* the name of the chunk.\n" +
11+ "Example: if your old code looked like this:\n" +
12+ " new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js')\n\n" +
13+ "You would change it to:\n" +
14+ " new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js' })\n\n" +
15+ "The available options are:\n" +
16+ " name: string\n" +
17+ " names: string[]\n" +
18+ " filename: string\n" +
19+ " minChunks: number\n" +
20+ " async: boolean\n" +
21+ " minSize: number\n" ) ;
22+ }
1023 if ( Array . isArray ( options ) || typeof options === "string" ) {
1124 options = {
1225 name : options
You can’t perform that action at this time.
0 commit comments