1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const path = require("path");
- const HtmlWebpack = require("html-webpack-plugin")
- // node写法
- module.exports = {
- mode: "production",
- // entry:'./src/a2.js'
- // entry:['./src/a2.js','./src/a3.js']
- // entry:{
- // hi:'./src/a2.js',
- // hello:'./src/a3.js'
- // },
- // entry:"./Conspicuous/bag.js",
- output: {
- // filename:'[name]-[id]-[hash].js',
- clean: true,
- // path:path.resolve(__dirname,'dist')
- },
- module: {
- rules: [
- {
- test: /\.css$/i,
- 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 HtmlWebpack({
- title:"哈哈哈哈",
- template:"./src/index.html"
- })
- ],
- //文件大小限制
- performance: {
- maxEntrypointSize: 50000000,
- maxAssetSize: 30000000,
- },
- devtool:"inline-source-map"
- };
|