Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LanceZhu
Copy link
Collaborator

Issue:将 src 改为其他目录名之后页面无法正常渲染

更改源码目录 src -> client

  • 更改入口 entry。如需使用指向源码目录的 alias @,需要在 build.json 中配置。
// build.json
{
	"entry": "client/app",
	"alias": {
		"@": "client"
	}
}
  • tsconfig.json 修改 srcclient

@LanceZhu LanceZhu requested a review from chenbin92 August 11, 2020 10:13
@LanceZhu
Copy link
Collaborator Author

LanceZhu commented Aug 11, 2020

遇到的问题:
plugin-router 依赖 react,在 hello-world 中通过 npm link的方式调试 plugin-router 时,导致存在两个 react

npm run start 报错:
react-hooks-error

解决方案

  1. plugin-router 中执行 npm link,将 hello-world 中的 react linkplugin-router 中。
    参考:invalid-hook-call-warning.html#duplicate-react

复现步骤

  1. 分支 release-next,最新 commit 30ae0a5db692d217455fe0167f225fa0baa7c8f9

commit

  1. npm run watch 编译 packages

  2. cd examples/hello-world

    npm i

    npm link ../../packages/plugin-router

  3. npm ls react 可以看到如下内容

react

npm run start

报错

error

@chenbin92
Copy link
Collaborator

冲突解决一下

@chenbin92 chenbin92 merged commit 159f7aa into release-next Aug 13, 2020
@LanceZhu LanceZhu mentioned this pull request Aug 13, 2020
5 tasks
@chenbin92 chenbin92 deleted the fix/src-rename branch August 17, 2020 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants