zoukankan      html  css  js  c++  java
  • 一套自己封装的简单脚手架!

    用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")
    }
     
    }
    }
    }
  • 相关阅读:
    css中滚动条设置
    css 字间距
    使用easyDialog弹出层后会刷新页面
    js页面跳转整理
    父容器不根据内容自适应高度的解决方法
    Freemaker 基本语法
    BeanUtils工具包下载及应用
    Java关键字final、static使用总结(二)
    What is a cross-channel pooling in convolutional neural net works?
    仿射梯度
  • 原文地址:https://www.cnblogs.com/robot666/p/11181401.html
Copyright © 2011-2022 走看看