Skip to content

Commit a19c426

Browse files
committed
review: installation
1 parent 9b467c4 commit a19c426

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/guide/installation.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Detailed release notes for each version are available on [GitHub](https://github
1818

1919
## Standalone
2020

21-
Simply download and include with a script tag. `Vue` will be registered as a global variable. **Pro tip: Don't use the minified version during development. You will miss out all the nice warnings for common mistakes.**
21+
Simply download and include with a script tag. `Vue` will be registered as a global variable.
22+
23+
<p class="tip">Don't use the minified version during development. You will miss out all the nice warnings for common mistakes!</p>
2224

2325
<div id="downloads">
2426
<a class="button" href="/js/vue.js" download>Development Version</a><span class="light info">With full warnings and debug mode</span>
@@ -47,6 +49,24 @@ NPM is the recommended installation method when building large scale application
4749
$ npm install vue@next
4850
```
4951

52+
### Note on NPM Builds
53+
54+
Because Single File Components pre-compile the templates into render functions at build time, the default export of the `vue` NPM package is the **runtime-only build**, which does not support the `template` option. If you still wish to use the `template` option, you will need to configure your bundler to alias `vue` to the standalone build.
55+
56+
With webpack, add the following alias to your webpack config:
57+
58+
``` js
59+
resolve: {
60+
alias: {
61+
vue: 'vue/dist/vue.js'
62+
}
63+
}
64+
```
65+
66+
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) for the same effect.
67+
68+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>
69+
5070
## CLI
5171

5272
Vue.js provides an [official CLI](https://github.com/vuejs/vue-cli) for quickly scaffolding ambitious Single Page Applications. It provides batteries-included build setups for a modern frontend workflow. It takes only a few minutes to get up and running with hot-reload, lint-on-save, and production-ready builds:

0 commit comments

Comments
 (0)