From c4b7f9af4947d447a1f07e169e348dceca345163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20R=C3=BCger?= Date: Mon, 22 Jan 2018 19:02:43 +0200 Subject: [PATCH] Add explicit version to download links (#1398) * Add explicit version to download links * improve CDN section of installation page --- pre-deploy.js | 1 + src/v2/guide/installation.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pre-deploy.js b/pre-deploy.js index db6ff70b4e..1abac6b4fa 100644 --- a/pre-deploy.js +++ b/pre-deploy.js @@ -39,6 +39,7 @@ Promise.all([ installation .replace(/vue_version: .*/, 'vue_version: ' + version) .replace(/gz_size:.*/g, `gz_size: "${prodSize}"`) + .replace(/\/vue@[\d\.]+\//g, `/vue@${version}/`) ) console.log(`\nSuccessfully updated Vue version and gzip file size.\n`) }).catch(err => { diff --git a/src/v2/guide/installation.md b/src/v2/guide/installation.md index 49547d9358..eb01c6a937 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -34,9 +34,18 @@ Simply download and include with a script tag. `Vue` will be registered as a glo ### CDN -Recommended: [https://cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [https://cdn.jsdelivr.net/npm/vue/](https://cdn.jsdelivr.net/npm/vue/). +We recommend linking to a specific version number that you can update manually: -Also available on [unpkg](https://unpkg.com/vue) and [cdnjs](https://cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js) (cdnjs takes some time to sync so the latest release may not be available yet). +``` html + +``` + +You can browse the source of the NPM package at [cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue/). + +Vue is also available on [unpkg](https://unpkg.com/vue@{{vue_version}}/dist/vue.js) and [cdnjs](https://cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js) (cdnjs takes some time to sync so the latest release may not be available yet). + +Make sure to read about [the different builds of Vue](#Explanation-of-Different-Builds) and use the **production + version** in your published site, replacing `vue.js` with `vue.min.js`. This is a smaller build optimized for speed instead of development experience. ## NPM