From f2aa066dd5009b969158d0e3393f78d22f6e19ae Mon Sep 17 00:00:00 2001 From: Alexandru Bucur Date: Thu, 24 Nov 2016 18:11:07 +0200 Subject: [PATCH 1/2] Add the browser option in package.json Works faster and better than aliasify and it's the default used in the vuejs browserify template --- src/v2/guide/installation.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/v2/guide/installation.md b/src/v2/guide/installation.md index 64717da8ae..2be0f54c7a 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -64,7 +64,13 @@ resolve: { } ``` -For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same. +For Browserify, you can modify your package.json as follows: +``` js +"browser": { + "vue": "vue/dist/vue.common" +}, +``` +or you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.

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.

From f5b11f2adf7cc276c4e50fc5545a40f3fcc818f1 Mon Sep 17 00:00:00 2001 From: Chris Fritz Date: Thu, 24 Nov 2016 12:52:18 -0500 Subject: [PATCH 2/2] Tweak browserify alias instructions --- src/v2/guide/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v2/guide/installation.md b/src/v2/guide/installation.md index 2be0f54c7a..ef2e32c229 100644 --- a/src/v2/guide/installation.md +++ b/src/v2/guide/installation.md @@ -64,13 +64,13 @@ resolve: { } ``` -For Browserify, you can modify your package.json as follows: +For Browserify, you can add an alias to your package.json: + ``` js "browser": { "vue": "vue/dist/vue.common" }, ``` -or you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.

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.