1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-03 20:07:35 +02:00

fix browserlist and add vendor.js chunk

This commit is contained in:
Kushagra Gour
2018-06-15 19:10:22 +05:30
parent 6616fab11c
commit dcd1cd80d4
2 changed files with 76 additions and 62 deletions

View File

@@ -60,5 +60,9 @@
"^create-react-class$": "preact-compat/lib/create-react-class",
"^react-addons-css-transition-group$": "preact-css-transition-group"
}
}
},
"browserslist": [
"last 3 Chrome versions",
"last 3 Firefox versions"
]
}

View File

@@ -1,4 +1,5 @@
import CopyWebpackPlugin from 'copy-webpack-plugin'
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
/**
* Function that mutates original webpack config.
@@ -12,6 +13,15 @@ export default function (config, env, helpers) {
if (env.isProd) {
config.devtool = false; // disable sourcemaps
config.plugins.push(
new CommonsChunkPlugin({
name: 'vendor',
minChunks: ({
resource
}) => /node_modules/.test(resource),
})
);
config.plugins.push(new CopyWebpackPlugin([{
context: `${__dirname}/src/assets`,
from: `*.*`