错误
WARNING in configuration
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
print.0989fjs (348 KiB)
vendors.0989fjs (357 KiB)
index.0989fjs (885 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
index (885 KiB)
index.0989fjs
vendors (357 KiB)
vendors.0989fjs
print (348 KiB)
print.0989fjs
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
这是配置文件
const webpack = require('webpack');
module.exports = {
// devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
compress:true,
port:9000,
host:'127.0.0.1',
hot: true,
},
entry: {
index: './src/index.js',
vendors: ['react'],
},
plugins: [
new CleanWebpackPlugin(['dist']),
new HTMLWebpackPlugin({
title: 'Code Splitting'
}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
output: {
filename: '[name].[hash:5]js',
path: path.resolve(__dirname, 'dist'),
hotUpdateChunkFilename: 'hot/hot-update.js', //指定热替换补丁js文件和
hotUpdateMainFilename: 'hot/hot-update.json', //json描述文件生成路径 ,每次文件变化都会生成一次
}
};
要如何处理呢
你这是webpack4的配置吧 webpack4的配置现在要加多一个mode来判断是开发环境还是生产环境
`const webpack = require('webpack');
module.exports = {
};`