210909 ๊ฐœ๋ฐœ๊ธฐ๋ก: src์™€ dist ์ฐจ์ด

2021. 9. 9. 23:19ใ†๐Ÿ“” TIL

๐ŸŽ  src/ ์™€ dist/ ์˜ ์ฐจ์ด

๋ฆฌ์•กํŠธ ๊ฐœ๋ฐœ์„ ํ•˜๋ฉด์„œ src์™€ dist ๊ฐ€ ๋ˆˆ์— ์ž์ฃผ ๋ฐŸํ˜”๋‹ค. src ๋Š” source ๋ผ๊ณ  ์–ด๋ฆผ์žก์•„ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

์šฐ๋ฆฌ์˜ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š”(?) ์ •๋„๋กœ ์—ฌ๊ฒผ๋Š”๋ฐ, dist ๋Š” ๋ฌด์—‡์ธ์ง€ ๊ฐ์ด ์žกํžˆ์ง€ ์•Š์•˜๋‹ค.

 

stackoverflow ์—์„œ ๋‘˜์˜ ์ฐจ์ด๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์–ด ์•ฝ๊ฐ„์˜ ์˜์—ญ์„ ๊ณ๋“ค์—ฌ ๊ธฐ๋กํ•œ๋‹ค.

 

๐Ÿ“Œ  src/

src/ stands for source, and is the raw code before minification or concatenation or some other compilation - used to read/edit the code.

src/๋Š” ์†Œ์Šค๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ ์ถ•์†Œ/์—ฐ๊ฒฐ, ๊ธฐํƒ€ ์ปดํŒŒ์ผ ๋˜๊ธฐ ์ „์˜ ์›์‹œ ์ฝ”๋“œ๋กœ, ์ฝ”๋“œ๋ฅผ ์ฝ๊ณ  ํŽธ์ง‘ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋œ๋‹ค.

(์ฆ‰ ๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฐœ๋ฐœํ•  ๋•Œ ์ž‘์„ฑํ•œ ์†Œ์Šค์ฝ”๋“œ)

 

๐Ÿ“Œ  dist/

dist/ stands for distribution, and is the minified/concatenated version - actually used on production sites. This is a common task that is done for assets on the web to make them smaller.

dist/๋Š” ๋ฐฐํฌ๋ฅผ ์˜๋ฏธํ•˜๋ฉฐ, ์‹ค์ œ ์šด์˜ ํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ถ•์†Œ/์—ฐ๊ฒฐ ๋ฒ„์ „์ด๋‹ค.

์ด๋Š” ์›น ์ƒ์—์„œ ์šฉ๋Ÿ‰(?)์„ ์ค„์ด๊ธฐ ์œ„ํ•ด ์ˆ˜ํ–‰ํ•˜๋Š” ์ผ๋ฐ˜์ ์ธ ์ž‘์—…์ด๋‹ค.

 

์›นํŒฉ์—์„œ src ์™€ dist ๋Š” ๊ฐ๊ฐ entry ์™€ output ์— ๋งค์นญ๋œ๋‹ค.

src/main.js ๋ฅผ ์‹œ์ž‘์ ์œผ๋กœ ํ•˜์—ฌ, ๋ฒˆ๋“ค๋œ ๊ฒฐ๊ณผ๋ฌผ์„ dist ๊ฒฝ๋กœ์— ์ถœ๋ ฅํ•œ๋‹ค.

 

 

ref

https://stackoverflow.com/questions/23730882/what-is-the-role-of-src-and-dist-folders