codestates / codestates/LearnRegex

[๐Ÿ‘พ ErrorLog] Public ๋””๋ ‰ํ† ๋ฆฌ ์ ‘๊ทผ

Open
#159 0 comments 0 reactions 1 assignee Claimed by @EUNYUSEO View on GitHub
ErrorLog
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.