当前位置 : 主页 > 手机开发 > 其它 >

一套自己封装的简单脚手架!

来源:互联网 收集:自由互联 发布时间:2021-06-19
用vue做项目时是不是总是遇到用git bash 安装如下的东西? 普通webpack安装git命令: cnpm install webpack webpack-cli -D cnpm install html-webpack-plugin -D cnpm install -D style-loader css-loader sass-loader node-sass
用vue做项目时是不是总是遇到用git bash 安装如下的东西?

普通webpack安装git命令:
cnpm install webpack webpack-cli -D
cnpm install html-webpack-plugin -D
cnpm install -D style-loader css-loader sass-loader node-sass
cnpm install --save-dev @babel/core babel-loader @babel/preset-env @babel/preset-react
cnpm install -D url-loader file-loader
cnpm install webpack-dev-server -D
cnpm install -D vue-loader vue-template-compiler
cnpm install vue -S

axios安装:
cnpm install axios -S

router安装:
cnpm install vue-router -S

脚手架安装:
cnpm install @vue/cli -g

vueX的安装:
cnpm install vuex --save
swiper的安装:
cnpm install swiper -S

此外,还有还有webpack.config.vue 配置的烦扰?那么这个时候如果多人开发vue的项目时,简单的封装可以从这儿开始!

 

const path = require("path"); //https://m.ximalaya.com/revision/seo/getTdk?typeName=OTHER&uri=%2F&tdkType=wap

 

module.exports = { devServer:{ open:true, proxy:{ "/abc":{ target:"https://m.ximalaya.com", changeOrigin:true,   pathRewrite:{ "^/abc":"" }   } } } }, configureWebpack:{ resolve:{ alias: { "@":path.resolve(__dirname,"./src/"), "common":path.resolve(__dirname,"./src/common"),

 

"hu_component":path.resolve(__dirname,"./src/components/hu_component"), "lai_component":path.resolve(__dirname,"./src/components/lai_component"), "xue_component":path.resolve(__dirname,"./src/components/xue_component"),

 

"hu_router":path.resolve(__dirname,"./src/router/hu_router"), "lai_router":path.resolve(__dirname,"./src/router/lai_router"), "xue_router":path.resolve(__dirname,"./src/router/xue_router"),

 

"hu_store":path.resolve(__dirname,"./src/store/hu_store"), "lai_store":path.resolve(__dirname,"./src/store/lai_store"), "xue_store":path.resolve(__dirname,"./src/store/xue_store"),

 

"utils":path.resolve(__dirname,"./src/utils"),

 

"hu_view":path.resolve(__dirname,"./src/views/hu_view"), "lai_view":path.resolve(__dirname,"./src/views/lai_view"), "xue_view":path.resolve(__dirname,"./src/views/xue_view"),   "api":path.resolve(__dirname,"./src/api") }   } } }
网友评论