mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-25 16:48:56 -06:00
docs(zh): update build-targets.md (#4505) [ci skip]
(cherry picked from commit c730b76f43)
This commit is contained in:
@@ -19,6 +19,11 @@
|
||||
|
||||
::: tip 注意对 Vue 的依赖
|
||||
在库模式中,Vue 是*外置的*。这意味着包中不会有 Vue,即便你在代码中导入了 Vue。如果这个库会通过一个打包器使用,它将尝试通过打包器以依赖的方式加载 Vue;否则就会回退到一个全局的 `Vue` 变量。
|
||||
|
||||
要避免此行为,可以在`build`命令中添加`--inline-vue`标志。
|
||||
```
|
||||
vue-cli-service build --target lib --inline-vue
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user