未验证 提交 fc082b92 编写于 作者: J Jacky Efendi 提交者: GitHub

Mark `preact` as externals for server bundle (#15110)

Co-authored-by: NJason Miller <developit@users.noreply.github.com>
上级 987d29a5
......@@ -14,6 +14,13 @@ module.exports = withPrefresh({
}
}
if (isServer) {
// mark `preact` stuffs as external for server bundle to prevent duplicate copies of preact
config.externals.push(
/^(preact|preact-render-to-string|preact-context-provider)([\\/]|$)/
)
}
// Install webpack aliases:
const aliases = config.resolve.alias || (config.resolve.alias = {})
aliases.react = aliases['react-dom'] = 'preact/compat'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册