# Build Performance
- 优化相关
- build-performance
# The Basic
- stay up to the
lastest
webpack and node version - Use the
include
field to only apply the loader modules thatactually
need to be transformed by it
const path = require('path');
module.exports = {
//...
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
loader: 'babel-loader',
},
],
},
};
- increase
resolving(解析)
speed - Use the
DllPlugin
to move code that is changed less often into a separate compilation, it improve the application'scompilation
speed - Try to keep chunks
small
bySplitChunksPlugin
# Development
- webpack's
watch
mode webpack-dev-server