Skip to content
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

Want to link local lib #1

Open
inocop opened this issue Sep 6, 2021 · 0 comments
Open

Want to link local lib #1

inocop opened this issue Sep 6, 2021 · 0 comments

Comments

@inocop
Copy link
Owner

inocop commented Sep 6, 2021

create-react-appは、ModuleScopePlugin でsrc外部のimportを制限しているらしい。
libの変更時にインストールし直すのが面倒なので、npmではなくローカルパスからインストールできると嬉しい。

- "pe-line-amount-calculator": "^1.0.8", 
+ "pe-line-amount-calculator": "link:./../lib/src"

react-app-rewired や craco などで create-react-app の webpackの設定を上書きできるっぽい。(できれば eject したくない)
react-app-rewired は create-react-app 2.0 までしかサポートしてないからダメそう。

参考リンク

https://github.com/facebook/create-react-app/issues/8785
https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory
@inocop inocop closed this as completed Sep 6, 2021
@inocop inocop changed the title リポジトリの内のlibを参照できない Link local lib Sep 6, 2021
@inocop inocop changed the title Link local lib Want to link local lib Sep 6, 2021
@inocop inocop reopened this Sep 6, 2021
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

No branches or pull requests

1 participant