一、webpack配置问题
webpack确实强大,但是配置loaderplugin也确实存在与nodenpmwebpack版本之间存在冲突问题(真正的从入门到放弃)。为了方便平时的开发,我基于webpack4.x 整合reactvue3、ts开发环境支持lesseslintbabel等,具体详见package.json

二、下载可以根据自己的实际需求修改package.json。下载地址https://gitee.com/jly1314520/mywebpack.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进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注