const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode:"production",
// development开发模式
// node无
// production 生产模式
// entry:"", 单个入口 默认index.js
// 对象写法
// entry:{
// text:"./src/text.js",
// text2:"./src/text2.js"
// },
// 数组写法
// entry:[
// "./src/text.js",
// "./src/text2.js"
// ],
output:{
clean:true,
},
module:{
rules:[
{
test:/\.css$/, //匹配正则
use:[
{loader:"style-loader"},
{loader:"css-loader"},
]
}
]
},
plugins: [new HtmlWebpackPlugin({
title: "打包工具webpack",
})],
}