Skip to content

Commit c4b7f9a

Browse files
rubydesignchrisvfritz
authored andcommitted
Add explicit version to download links (vuejs#1398)
* Add explicit version to download links * improve CDN section of installation page
1 parent 23f59fe commit c4b7f9a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pre-deploy.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Promise.all([
3939
installation
4040
.replace(/vue_version: .*/, 'vue_version: ' + version)
4141
.replace(/gz_size:.*/g, `gz_size: "${prodSize}"`)
42+
.replace(/\/vue@[\d\.]+\//g, `/vue@${version}/`)
4243
)
4344
console.log(`\nSuccessfully updated Vue version and gzip file size.\n`)
4445
}).catch(err => {

src/v2/guide/installation.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,18 @@ Simply download and include with a script tag. `Vue` will be registered as a glo
3434

3535
### CDN
3636

37-
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/).
37+
We recommend linking to a specific version number that you can update manually:
3838

39-
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).
39+
``` html
40+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
41+
```
42+
43+
You can browse the source of the NPM package at [cdn.jsdelivr.net/npm/vue](https://cdn.jsdelivr.net/npm/vue/).
44+
45+
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).
46+
47+
Make sure to read about [the different builds of Vue](#Explanation-of-Different-Builds) and use the **production
48+
version** in your published site, replacing `vue.js` with `vue.min.js`. This is a smaller build optimized for speed instead of development experience.
4049

4150
## NPM
4251

0 commit comments

Comments
 (0)