package.json
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack",
"dev": "webpack-dev-server"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.15.8", // babel文件 用于低版本浏览器兼容es6
"@babel/preset-env": "^7.15.8",
"babel-core": "^6.26.3",
"babel-loader": "^8.2.3",
"babel-preset-env": "^1.7.0",
"clean-webpack-plugin": "^4.0.0", // 清理打包后的文件
"css-loader": "^6.4.0",
"file-loader": "^6.2.0", // 和url-loader一起
"html-webpack-plugin": "^5.4.0",
"html-withimg-loader": "^0.1.16", // html页面图片路径处理
"less": "^4.1.2",
"less-loader": "^10.2.0",
"mini-css-extract-plugin": "^2.4.3", // 打包后css放入css文件夹
"style-loader": "^3.3.0",
"url-loader": "^4.1.1", // 处理路径
"webpack": "^5.59.1",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.3.1" //run dev 在浏览器中运行
}
}
``