const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
  mode: 'development',
  // entry: [
  //   './src/a1.js',
  //   './src/a2.js'
  // ],
  // entry: {
  //   hello1: './src/a1.js',
  //   hello2: './src/a2.js'
  // },
  output: {
    // filename: '[name]-[id]-[hash].js',
    filename: 'file5.js',
    clean: true,
    // path: path.resolve(__dirname, 'hello')
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      },
      {
        test: /\.(png|svg|jpg|jpeg|gif)$/i,
        type: 'asset/resource',
      },
      {
        test: /\.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    ]
  },
  plugins: [new HtmlWebpackPlugin({
    // title: 'hhhh哈哈哈',
    // template: './src/demo.html'
  })],
  devtool:"inline-source-map"
}