mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-04 12:27:28 +02:00
fix browserlist and add vendor.js chunk
This commit is contained in:
@@ -60,5 +60,9 @@
|
|||||||
"^create-react-class$": "preact-compat/lib/create-react-class",
|
"^create-react-class$": "preact-compat/lib/create-react-class",
|
||||||
"^react-addons-css-transition-group$": "preact-css-transition-group"
|
"^react-addons-css-transition-group$": "preact-css-transition-group"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"last 3 Chrome versions",
|
||||||
|
"last 3 Firefox versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import CopyWebpackPlugin from 'copy-webpack-plugin'
|
import CopyWebpackPlugin from 'copy-webpack-plugin'
|
||||||
|
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that mutates original webpack config.
|
* Function that mutates original webpack config.
|
||||||
@@ -12,6 +13,15 @@ export default function (config, env, helpers) {
|
|||||||
if (env.isProd) {
|
if (env.isProd) {
|
||||||
config.devtool = false; // disable sourcemaps
|
config.devtool = false; // disable sourcemaps
|
||||||
|
|
||||||
|
config.plugins.push(
|
||||||
|
new CommonsChunkPlugin({
|
||||||
|
name: 'vendor',
|
||||||
|
minChunks: ({
|
||||||
|
resource
|
||||||
|
}) => /node_modules/.test(resource),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
config.plugins.push(new CopyWebpackPlugin([{
|
config.plugins.push(new CopyWebpackPlugin([{
|
||||||
context: `${__dirname}/src/assets`,
|
context: `${__dirname}/src/assets`,
|
||||||
from: `*.*`
|
from: `*.*`
|
||||||
|
Reference in New Issue
Block a user