const path = require('path'); module.exports = { mode: 'production', // 配置打包入口 // entry:'./src/hello.js', // entry: { // a:'./src/hello.js', // b:'./src/index.js' // }, output: { // filename:'[name]-[id]-[hash].js' clean: true, path: path.resolve(__dirname, 'dist') }, module: { rules: [ { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, { // png|svg|jpg|jpeg|gif 区别 test: /\.(png|svg|jpg|jpeg|gif)$/i, type: 'asset/resource', }, ] } }