0

我正在尝试使用 react-router-4 设置服务器渲染反应。虽然它在前端(Webpack)上工作得很好。在服务器端使用时似乎preact-compat不起作用。我正在使用babel-register转换代码。

图片

我这里有一个分支供参考: https ://github.com/abrcenas29/preact-sandbox-v0/tree/wip/isomorphic-react

跑步: yarn run install yarn run start:prod

localhost:3100

4

1 回答 1

1

使用 Babel 对依赖项进行别名是没有意义的,因为 Babel 不会在您的依赖项上运行(在 node_modules 中)。改用模块别名之类的东西。

同一问题的完整答案在 Github 上:https ://github.com/developit/preact-compat/issues/390#issuecomment-304334947

于 2017-05-26T17:12:16.167 回答