Code Monkey home page Code Monkey logo

sass_demo's Introduction

Vue多项目脚手架

相关命令

创建项目

npm create 项目名称

项目创建成功后会在根目录下 projects.json 添加项目配置,可查找以生成的相关项目名称和配置

ps:npm run create 项目名称 项目描述【可为中文描述】 不可用 yarn create 创建项目 因 crate 命令 yarn 有自实现

运行开发环境

npm run serve 项目名称
//or
yarn serve 项目名称

开发环境下默认会自动注入 vconsole 调试工具

开发环境打包

npm run build:test 项目名称
//or
yarn build:test 项目名称

开发环境打包并唤起 webpack-bundle-analyzer

npm run build:test 项目名称 report
//or
yarn build:test 项目名称 report

线上环境打包

npm run build 项目名称
//or
yarn build 项目名称

线上环境打包并唤起 webpack-bundle-analyzer

npm run build 项目名称 report
//or
yarn build 项目名称 report

项目打包优化拓展

如需使用 cdn 加速,可在project.json中如下配置

{
  "projectName": {
    "describe": "项目描述",
    "cdn": {
      "externals": {
        "vue": "Vue",
        "vue-router": "VueRouter",
        "axios": "axios",
        "vuex": "Vuex"
      },
      "js": [
        "https://cdn.bootcss.com/vue/2.6.10/vue.runtime.min.js",
        "https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js",
        "https://cdn.bootcss.com/axios/0.19.0/axios.min.js",
        "https://cdn.bootcss.com/vuex/3.1.2/vuex.min.js"
      ],
      "css": []
    }
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.