123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- const path = require("path");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- // 抛出
- module.exports = {
- mode: "production",
- entry: "./src/b.js",
- // entry:'./news.js',
- entry: ["./src/a.js", "./src/b.js"],
- // entry:{
- // hi:'./src/a.js',
- // hello:'./src/b.js'
- // }
- output: {
- // filename:'[name]-[id]-[hash].js',
- // path:path.resolve(__dirname,'dist'),
- clean: true,
- },
- module: {
- rules: [
- {
- test: /\.css$/i,
- use: ["style-loader", "css-loader"],
- },
- {
- // v-if v-for优先级谁高 (v2/v3)
- // png|svg|jpg|jpeg|gif 区别
- 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:"你好啊"})],
- };
|