测试所用的配置文件:

const path = require('path');
const HtmlWebpackPlugin= require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin')
const webpack= require('webpack');

module.exports = {
  entry: {
    main: './src/main.js'
  },
  output: {
    filename: '[name].[chunkhash].js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
      rules: [
      {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
      }
      ]
  },
  plugins: [
      new HtmlWebpackPlugin({
       title: 'Output Management'
    }),
    new CleanWebpackPlugin(['dist'])
  ],
  devtool: 'eval'
};
View Code

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-01-17
  • 2021-12-25
  • 2022-12-23
  • 2021-12-24
  • 2021-04-27
猜你喜欢
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案