Skip to content

Commit

Permalink
docs(zh): update build-targets.md (vuejs#4505) [ci skip]
Browse files Browse the repository at this point in the history
(cherry picked from commit c730b76)
  • Loading branch information
zhouxinyong authored and haoqunjiang committed Sep 24, 2019
1 parent dcd2a85 commit ba97068
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/zh/guide/build-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

::: tip 注意对 Vue 的依赖
在库模式中,Vue 是*外置的*。这意味着包中不会有 Vue,即便你在代码中导入了 Vue。如果这个库会通过一个打包器使用,它将尝试通过打包器以依赖的方式加载 Vue;否则就会回退到一个全局的 `Vue` 变量。

要避免此行为,可以在`build`命令中添加`--inline-vue`标志。
```
vue-cli-service build --target lib --inline-vue
```
:::


Expand Down

0 comments on commit ba97068

Please sign in to comment.