一、webpack配置问题
webpack确实强大,但是配置loader、plugin也确实存在与node、npm、webpack版本之间存在冲突的问题(真正的从入门到放弃)。为了方便平时的开发,我基于webpack4.x 整合了react、vue3、ts开发环境,支持less、eslint、babel等,具体详见package.json。
二、下载后可以根据自己的实际需求修改package.json。下载地址:https://gitee.com/jly1314520/my–webpack.git。
{
"name": "testwebpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack",
"server": "webpack-dev-server --open",
"mpa": "webpack --config ./webpack.mpa.config.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"autoprefixer": "^10.1.0",
"babel-loader": "^8.3.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.1",
"cssnano": "^4.1.10",
"eslint": "^8.54.0",
"eslint-config-semistandard": "^17.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1",
"express": "^4.17.1",
"file-loader": "^6.2.0",
"glob": "^7.1.6",
"html-webpack-plugin": "^4.5.0",
"less": "^3.5.0",
"less-loader": "^7.1.0",
"mini-css-extract-plugin": "^1.3.3",
"postcss": "^8.2.1",
"postcss-loader": "^4.1.0",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"vue-loader": "^17.3.1",
"vue-template-compiler": "^2.7.15",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"axios": "^0.21.1",
"core-js": "^2.6.12",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"vue": "^3.3.8"
}
}
原文地址:https://blog.csdn.net/weixin_44768421/article/details/134473856
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_#ID#.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。