Skip to content

Commit 480f39e

Browse files
committed
fix npm main export instructions
1 parent ce0f7ab commit 480f39e

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/guide/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ $ npm install vue
4747

4848
There are two builds available, the standalone build and the runtime-only build.
4949

50-
- The standalone build includes the compiler and supports the `template` option.
50+
- The standalone build includes the compiler and supports the `template` option. **It also relies on the presence of browser APIs so you cannot use it for server-side rendering.**
5151

5252
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
5353

54-
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
54+
By default, the NPM package exports the **runtime-only** build. To use the standalone build, add the following alias to your webpack config:
5555

5656
``` js
5757
resolve: {
5858
alias: {
59-
vue: 'vue/dist/vue.common.js'
59+
vue: 'vue/dist/vue.js'
6060
}
6161
}
6262
```
6363

6464
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.
6565

66-
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - 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>
66+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.js'` - 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>
6767

6868
### CSP environments
6969

src/guide/single-file-components.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,3 @@ NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
9999
``` bash
100100
NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o build.css ] -e main.js | uglifyjs -c -m > build.js
101101
```
102-
103-
### Use the Runtime-Only Build
104-
105-
There are two builds available, the standalone build and the runtime-only build.
106-
107-
- The standalone build includes the compiler and supports the `template` option.
108-
109-
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
110-
111-
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
112-
113-
``` js
114-
resolve: {
115-
alias: {
116-
vue: 'vue/dist/vue.common.js'
117-
}
118-
}
119-
```
120-
121-
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.
122-
123-
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - 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>

0 commit comments

Comments
 (0)