Skip to content

Commit

Permalink
Adopt Mix extract default SplitChunksPlugin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox committed Mar 15, 2019
1 parent 1969d3e commit 9178c3c
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ mix.webpackConfig({
'styles': path.resolve('frontend/scss')
}
},
optimization: {
runtimeChunk: {
name: 'assets/admin/js/manifest'
},
splitChunks: {
cacheGroups: {
vendor: {
test (module, chunks) {
// This prevents stylesheet resources with these extensions
// from being moved from their original chunk to the vendor chunk
if (module.resource && (/^.*\.(css|scss|less)$/).test(module.resource)) {
return false
}
return module.context && module.context.indexOf('node_modules') !== -1
},
chunks: "initial",
name: "assets/admin/js/vendor",
enforce: true
}
}
}
},
module: {
rules: [
{
Expand Down Expand Up @@ -81,6 +59,8 @@ mix.js(
'public/assets/admin/css'
)

mix.extract()

if (mix.inProduction()) {
mix.version()
} else {
Expand Down

0 comments on commit 9178c3c

Please sign in to comment.