-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(migrate): CCP to SCP - regex support, minChunks, async chunks
- Loading branch information
Showing
6 changed files
with
275 additions
and
148 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
2 changes: 1 addition & 1 deletion
2
packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-5.input.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.export = { | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
names: ["runtime"], | ||
names: ["main", "runtime"], | ||
}) | ||
] | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-6.input.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,26 @@ | ||
module.export = { | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
name: "main", | ||
minChunks: ({ resource }) => /node_modules/.test(resource), | ||
minChunks: ({ resource }) => { | ||
var foo = "bar"; | ||
return /node_modules/.test(resource); | ||
}, | ||
minChunks: function ({ resource }) { | ||
var foo = "bar"; | ||
return /node_modules/.test(resource); | ||
}, | ||
minChunks: function ({ resource }) { | ||
var foo = "bar"; | ||
if (foo) { | ||
return /node_modulesfoo/.test(resource); | ||
} else if (foo === "something") { | ||
return /node_modulesbar/.test(resource); | ||
} else { | ||
return /node_modulesbaz/.test(resource); | ||
} | ||
} | ||
}) | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/migrate/commonsChunkPlugin/__testfixtures__/commonsChunkPlugin-7.input.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,11 @@ | ||
module.export = { | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
names: ["main", "vendor"], | ||
minChunks: Infinity, | ||
}), | ||
// new webpack.optimize.CommonsChunkPlugin({ | ||
// name: "vendor", | ||
// }), | ||
] | ||
} |
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
Oops, something went wrong.