| 123456789101112131415161718192021222324252627282930313233343536373839 |
- // const path = require("path");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- module.exports = {
- mode: "production",
- // mode:"development",
- entry: "./src/index.js",
- // entry: ['./src/a.js','./src/index.js']
- // entry: {
- // hi:"./src/a.js",
- // aa: "./src/index.js"
- // }
- output: {
- // filename:'[name]-[id]-[hash].js',
- // path:path.resolve(__dirname,'dist')
- clean: true
- },
- module: {
- rules: [
- {
- test: /\.css$/i,
- use: ['style-loader', 'css-loader'],
- },
- {
- test: /\.(png|svg|jpg|jpeg|gif)$/i,
- type: 'asset/resource',
- },
- ],
- },
- plugins:[
- new HtmlWebpackPlugin({ template: './src/index.html' })
- ],
- // 映射源码
- devtool:"inline-source-map",
- // 文件限制
- performance:{
- maxEntrypointSize: 5000000000,
- maxAssetSize: 2000000000
- }
- }
|