Benjamin Lim
2017-02-08 02:27:07 +08:00
parent f522cb689b
commit f0bebc6824
3 changed files with 12 additions and 8 deletions
@@ -58,7 +58,10 @@ configuration = {
configuration = {
// ...
plugins: [
new optimize.CommonsChunkPlugin("commons", "commons.js"),
new optimize.CommonsChunkPlugin({
name: "commons",
filename: "commons.js",
}),
new ExtractTextPlugin("[name].css")
]
};
-1
View File
@@ -1002,7 +1002,6 @@ declare namespace webpack {
new (options?: UglifyPluginOptions): Plugin;
}
interface CommonsChunkPluginStatic {
new (chunkName: string, filenames?: string | string[]): Plugin;
new (options?: any): Plugin;
}
interface AggressiveMergingPluginStatic {
+8 -6
View File
@@ -62,7 +62,10 @@ configuration = {
filename: "bundle.js"
},
plugins: [
new webpack.optimize.CommonsChunkPlugin(/* chunkName= */"vendor", /* filename= */"vendor.bundle.js")
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename: "vendor.bundle.js",
}),
]
};
@@ -126,10 +129,6 @@ configuration = {
output: {
filename: "[name].js"
},
plugins: [
new CommonsChunkPlugin("admin-commons.js", ["ap1", "ap2"]),
new CommonsChunkPlugin("commons.js", ["p1", "p2", "admin-commons.js"])
]
};
// <script>s required:
// page1.html: commons.js, p1.js
@@ -145,7 +144,10 @@ configuration = {
commons: "./entry-for-the-commons-chunk"
},
plugins: [
new CommonsChunkPlugin("commons", "commons.js")
new CommonsChunkPlugin({
name: "commons",
filename: "commons.js",
}),
]
};