package.json
{
"name": "web",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack"
},
"author": "",
"license": "ISC",
"devDependencies": {
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"eventemitter3": "^4.0.0",
"jquery": "^3.4.1",
"socket.io-client": "^2.3.0",
"terser-webpack-plugin": "^2.3.5",
"terser-webpack-plugin-legacy": "^1.2.3"
}
}
webpack.config.js
const webpack = require('webpack'); //访问内置的插件
const path = require('path');
module.exports={
entry: './src/src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist')
},
// optimization: {
// minimizer: [new TerserPlugin({
// cache: true,
// parallel: true,
// })],
// },
mode: 'production', //模式 none
}
网友评论