{test: /\.js$/,exclude: /node_modules/,use: [/*开启多进程打包。进程启动大概为 600ms,进程通信也有开销。只有工作消耗时间比较长,才需要多进程打包*/{loader: 'thread-loader', options: {workers: 2 // 进程 2 个}},{loader: 'babel-loader', options: {presets: [ ['@babel/preset-env',{useBuiltIns: 'usage',corejs: { version: 3 },targets: {chrome: '60',firefox: '50'}}]],// 开启 babel 缓存// 第二次构建时,会读取之前的缓存cacheDirectory: true}}]},
