webpack相关依赖:
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^5.8.0",
"webpack-dev-middleware": "^5.3.1"
其他相关依赖:
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/plugin-transform-arrow-functions": "^7.16.7",
"@babel/plugin-transform-block-scoping": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"autoprefixer": "^10.4.4",
"babel-loader": "^8.2.4",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.7.1",
"html-webpack-plugin": "^5.5.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"postcss": "^8.4.12",
"postcss-cli": "^9.1.0",
"postcss-loader": "^6.2.1",
"postcss-preset-env": "^7.4.3",
"style-loader": "^3.3.1",
"ts-loader": "^9.2.8",
"vue": "^2.6.14",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.14",
注:
vue-loader版本为14或15时,支持vue2;vue-loader>16版本时,支持vue3。
vue-loader版本为15时需要进行VueLoaderPlugin
的插件配置,配置如下:
// webpack.config.js
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
plugins:[
new VueLoaderPlugin();
]
}
若想寻找官方推荐的使用版本,可进入npm官方网址搜索自己需要的依赖包;然后查看versions;一般安装Current Tags中的版本即可。