Skip to content

Commit

Permalink
feat(migrate): CCP to SCP - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvdutt committed Aug 7, 2018
1 parent 6329aaa commit 846cc5a
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-0" da
cacheGroups: {
common: {
name: 'common',
chunks: 'initial',
enforce: true,
name: 'common'
enforce: true
},
vendor: {
name: 'vendor',
chunks: 'initial',
enforce: true,
name: 'vendor',
test: '/node_modules/'
}
}
Expand All @@ -32,15 +32,15 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-1" da
splitChunks: {
cacheGroups: {
common: {
name: 'common',
chunks: 'initial',
enforce: true,
name: 'common'
enforce: true
},
vendor: {
name: 'vendor',
chunks: 'initial',
enforce: true,
name: 'vendor',
test: '/node_modules/'
}
}
Expand All @@ -56,9 +56,9 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-2" da
splitChunks: {
cacheGroups: {
vendor: {
name: 'vendor',
chunks: 'initial',
enforce: true,
name: 'vendor',
test: '/node_modules/'
}
}
Expand All @@ -74,9 +74,9 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-3" da
splitChunks: {
cacheGroups: {
commons: {
name: 'commons',
chunks: 'initial',
enforce: true,
name: 'commons'
enforce: true
}
}
}
Expand All @@ -95,8 +95,6 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-4" da
cacheGroups: {
main: {
chunks: 'initial',
enforce: true,
name: 'main'
}
}
Expand All @@ -112,9 +110,9 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-5" da
splitChunks: {
cacheGroups: {
main: {
name: 'main',
chunks: 'initial',
enforce: true,
name: 'main'
enforce: true
}
}
},
Expand All @@ -131,15 +129,15 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-6" da
splitChunks: {
cacheGroups: {
main: {
name: 'main',
chunks: 'initial',
enforce: true,
name: 'main'
enforce: true
},
name: {
name: 'name',
chunks: 'initial',
enforce: true,
name: 'name',
test: ({ resource }) => /node_modules/.test(resource),
test: ({ resource }) => {
Expand Down Expand Up @@ -178,15 +176,15 @@ exports[`commonsChunkPlugin transforms correctly using "commonsChunkPlugin-7" da
cacheGroups: {
main: {
name: 'main',
chunks: 'initial',
enforce: true,
name: 'main'
enforce: true
},
vendor: {
name: 'vendor',
chunks: 'initial',
enforce: true,
name: 'vendor',
test: '/node_modules/'
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["common", "vendor"],
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["common", "vendor"],
minChunks: 2
})
]
})
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["common", "vendor"]
})
]
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["common", "vendor"]
})
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["vendor"]
})
]
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["vendor"]
})
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
plugins: [
new webpack.optimize.CommonsChunkPlugin({
filename: "commons.js",
name: "commons"
})
]
]
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "main",
async: true,
minSize: 0,
minChunks: 2
async: true,
minSize: 0,
minChunks: 2
})
]
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["main", "runtime"],
})
]
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "main",
minChunks: ({ resource }) => /node_modules/.test(resource),
minChunks: ({ resource }) => {
Expand All @@ -22,5 +22,5 @@ module.export = {
}
}
})
]
]
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.export = {
plugins: [
new webpack.optimize.CommonsChunkPlugin({
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ["main", "vendor"],
minChunks: Infinity,
}),
// new webpack.optimize.CommonsChunkPlugin({
// name: "vendor",
// }),
]
})
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-0");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-1");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-2");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-3");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-4"); // todo fix async case
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-4");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-5");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-6");
defineTest(__dirname, "commonsChunkPlugin", "commonsChunkPlugin-7");
Loading

0 comments on commit 846cc5a

Please sign in to comment.