1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-31 18:50:14 +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

@@ -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: `*.*`