Skip to content

Commit ba97068

Browse files
zhouxinyonghaoqunjiang
authored andcommitted
docs(zh): update build-targets.md (#4505) [ci skip]
(cherry picked from commit c730b76)
1 parent dcd2a85 commit ba97068

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/zh/guide/build-targets.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919

2020
::: tip 注意对 Vue 的依赖
2121
在库模式中,Vue 是*外置的*。这意味着包中不会有 Vue,即便你在代码中导入了 Vue。如果这个库会通过一个打包器使用,它将尝试通过打包器以依赖的方式加载 Vue;否则就会回退到一个全局的 `Vue` 变量。
22+
23+
要避免此行为,可以在`build`命令中添加`--inline-vue`标志。
24+
```
25+
vue-cli-service build --target lib --inline-vue
26+
```
2227
:::
2328

2429

0 commit comments

Comments
 (0)