Coder Social home page Coder Social logo

vue-cli3-optimization's Introduction

vue-cli3-optimization

基于 vue-cli@3 做的关于 CDN + Gzip + Prerender + Sass 的优化。在基于 vue-cli@2 的项目 vue-optimization 里已经对这些优化方案做了详细说明。你也可以阅读我的这篇博客。这个仓库旨在展示最终的优化结果,细节可以通过查看 git 历史了解,相应的地方也有详细注释。

注意!!!预渲染需要下载 Chromium ,而由于你懂的原因,谷歌的东西在国内无法下载,所以在根目录添加了.npmrc文件,来使用淘宝镜像下载。参考链接。如果你的终端可以翻到国外,直接忽略这一步,你也许会喜欢小飞机

使用 iView 的同学需要注意!!!在非 template/render 模式下(例如使用 CDN 引用时),组件名要分隔。例如 DatePicker 必须要写成 date-picker。部分组件,需要加前缀 i-。具体参考 iView 文档此 ISSUE

创建时的预设,详情参见.vuerc参考链接

{
  "packageManager": "npm",
  "useTaobaoRegistry": false,
  "presets": {
    "vue-optimization": {
      "useConfigFiles": true,
      "plugins": {
        "@vue/cli-plugin-babel": {},
        "@vue/cli-plugin-eslint": {
          "config": "standard",
          "lintOn": [
            "save"
          ]
        }
      },
      "router": true,
      "routerHistoryMode": true,
      "vuex": true,
      "cssPreprocessor": "sass"
    }
  }
}

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint

vue-cli3-optimization's People

Contributors

haochuan9421 avatar io-o avatar

Watchers

James Cloos avatar

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.