Skip to content

Update build-config.md #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/zh/guide/build-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const renderer = createBundleRenderer('/path/to/vue-ssr-server-bundle.json', {

请注意,在 `externals` 选项中,我们将 CSS 文件列入白名单。这是因为从依赖模块导入的 CSS 还应该由 webpack 处理。如果你导入依赖于 webpack 的任何其他类型的文件(例如 `*.vue`, `*.sass`),那么你也应该将它们添加到白名单中。

如果你使用 `runInNewContext: 'once'` 或 `runInNewContext: true`,那么你还应该将修改 `global` 的 polyfill 列入白名单,例如 `babel-polyfill`。这是因为当使用新的上下文模式时,**server bundle 中的代码具有自己的 `global` 对象。**由于在使用 Node 7.6+ 时,在服务器并不真正需要它,所以实际上只需在客户端 entry 导入它。
如果你使用 `runInNewContext: 'once'` 或 `runInNewContext: true`,那么你还应该将修改 `global` 的 polyfill 列入白名单,例如 `babel-polyfill`。这是因为当使用新的上下文模式时,**server bundle 中的代码具有自己的 `global` 对象。**
由于在使用 Node 7.6+ 时,在服务器并不真正需要它,所以实际上只需在客户端 entry 导入它。

## 客户端配置 (Client Config)

Expand Down