From 9ca7f54728a2fb1261b473ccefaf7c38f1ab9e47 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 22 Jan 2018 14:33:23 +0200 Subject: [PATCH 1/2] Add explicit version to download links --- src/v2/guide/installation.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/v2/guide/installation.md b/src/v2/guide/installation.md index 49547d9358..664bfa9fb5 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -34,9 +34,15 @@ 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/). +Recommended: +Use the latest development version [https://cdn.jsdelivr.net/npm/vue@{{vue_version}}/dist/vue.js](https://cdn.jsdelivr.net/npm/vue@{{vue_version}}/dist/vue.js), and update when you are ready. Or you can use the link to the latest versions, +[https://cdn.jsdelivr.net/npm/vue/dist/vue.js](https://cdn.jsdelivr.net/npm/vue/dist/vue.js), which will reflect the latest version as soon as it is published to npm (at your own risk). +You can also browse the source of the npm package at [https://cdn.jsdelivr.net/npm/vue/](https://cdn.jsdelivr.net/npm/vue/). -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). +Also available on [https://unpkg.com/vue@2.5.13/dist/vue.js](https://unpkg.com/vue@2.5.13/dist/vue.js) and [https://cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js](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). + +Remember to read the section about different versions, and use the **product + version** in production (basically replace `vue.js` with `vue.min.js`). ## NPM From c56813ae1d9d8cb459c38c8932eb75563cf8c11b Mon Sep 17 00:00:00 2001 From: Chris Fritz Date: Mon, 22 Jan 2018 11:58:15 -0500 Subject: [PATCH 2/2] improve CDN section of installation page --- pre-deploy.js | 1 + src/v2/guide/installation.md | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 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 664bfa9fb5..eb01c6a937 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -34,15 +34,18 @@ Simply download and include with a script tag. `Vue` will be registered as a glo ### CDN -Recommended: -Use the latest development version [https://cdn.jsdelivr.net/npm/vue@{{vue_version}}/dist/vue.js](https://cdn.jsdelivr.net/npm/vue@{{vue_version}}/dist/vue.js), and update when you are ready. Or you can use the link to the latest versions, -[https://cdn.jsdelivr.net/npm/vue/dist/vue.js](https://cdn.jsdelivr.net/npm/vue/dist/vue.js), which will reflect the latest version as soon as it is published to npm (at your own risk). -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 [https://unpkg.com/vue@2.5.13/dist/vue.js](https://unpkg.com/vue@2.5.13/dist/vue.js) and [https://cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js](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). -Remember to read the section about different versions, and use the **product - version** in production (basically replace `vue.js` with `vue.min.js`). +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