Skip to content

Commit

Permalink
Merge pull request #599 from YinDongFang/patch-1
Browse files Browse the repository at this point in the history
Update dep-pre-bundling.md
  • Loading branch information
ShenQingchuan authored Sep 9, 2022
2 parents 5c8ba68 + f06739a commit 64fee05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guide/dep-pre-bundling.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Pre-bundling dependencies: (正在预构建依赖:)

## Monorepo 和链接依赖 {#monorepos-and-linked-dependencies}

在一个 monorepo 启动中,该仓库中的某个依赖可能会成为另一个包的依赖。Vite 会自动侦测没有从 `node_modules` 解析的依赖项,并将链接的依赖视为源码。它不会尝试打包被链接的依赖,而是会分析被链接依赖的依赖列表。
在一个 monorepo 启动中,该仓库中的某个包可能会成为另一个包的依赖。Vite 会自动侦测没有从 `node_modules` 解析的依赖项,并将链接的依赖视为源码。它不会尝试打包被链接的依赖,而是会分析被链接依赖的依赖列表。

然而,这需要被链接的依赖被导出为 ESM 格式。如果不是,那么你可以在配置里将此依赖添加到 [`optimizeDeps.include`](/config/dep-optimization-options.md#optimizedeps-include)[`build.commonjsOptions.include`](/config/build-options.md#build-commonjsoptions) 这两项中。

Expand Down

1 comment on commit 64fee05

@vercel
Copy link

@vercel vercel bot commented on 64fee05 Sep 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cn-vitejs-dev – ./

cn-vitejs-dev-vuejs.vercel.app
cn.vitejs.dev
cn-vitejs-dev-git-main-vuejs.vercel.app
docs-cn.vercel.app

Please sign in to comment.