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:
@@ -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: `*.*`
|
||||
|
Reference in New Issue
Block a user