codestates / codestates/LearnRegex
[๐พ ErrorLog] Public ๋๋ ํ ๋ฆฌ ์ ๊ทผ
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
์ด๋ค ์๋ฌ์ธ๊ฐ?
* Public ๋๋ ํ ๋ฆฌ์ Tutorial ํ์ด์ง์์ ์ธ dummyData๋ฅผ ์์ฑํ๋๋ฐ src/Tutorial.js์์ import ๋์ง ์๋ ์ด์
์๋ฌ ๋ฉ์์ง
```js
Module not found: You attempted to import ../../public/data/tutorialData which falls outside of the project src/ directory.
Relative imports outside of src/ are not supported.
```
์๋ฌ ํด๊ฒฐ ๋ฐฉ๋ฒ
#### cra(creat-react-app)์์ import๋ก ์ฎ์ธ js, css, img๋ฑ๋ฑ์ ์ปดํ์ผ์ srcํ์ผ ์์์๋ง ์ด๋ค์ง๋ค.
* public - ์ ์ ํ์ผ์ ๋ฃ๋ ๋๋ ํ ๋ฆฌ (index.html์ ๋น๋กฏํ html ํ์ผ, img ๋ฑ)
* src directory - ๊ฐ๋ฐํ๋ฉด์ ์์
ํ๋ ํ์ผ ๋๋ถ๋ถ์ ๋ฃ๋ ๋๋ ํ ๋ฆฌ (index.js, ๊ทธ ์ธ ๋ฆฌ์กํธ ์ปดํฌ๋ํธ ๊ฐ์ js ํ์ผ, css ํ์ผ ๋ฑ)
* dummyData๋ฅผ json ํ์ผ๋ก ์์ฑ ํ ์ ๋๊ฒฝ๋ก๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ด ์์ง๋ง js ํ์ผ๋ก ๋ง๋ค๊ฑฐ๊ธฐ ๋๋ฌธ์ src ๋๋ ํ ๋ฆฌ๋ก ์ด๋
* ์ ๋๊ฒฝ๋ก ์ง์ ํ๋ ๋ฐฉ๋ฒ - `{process.env.PUBLIC_URL + "๊ฒฝ๋ก"}`๋ฅผ ์จ์ฃผ๋ฉด ๋๋ค.
์๋ฌ ํด๊ฒฐ์ ์ํด ์ฐธ๊ณ ํ ๋ ํผ๋ฐ์ค ๋งํฌ
* https://bokjiho.medium.com/react-%EB%A6%AC%EC%95%A1%ED%8A%B8%EC%97%90%EC%84%9C-%EC%9D%B4%EB%AF%B8%EC%A7%80-%EA%B2%BD%EB%A1%9C-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0-public-src-%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC-%EC%B0%A8%EC%9D%B4-fddb4f455c2a
* https://britny-no.tistory.com/21
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.