์ค๋ฅ๋ ์๋์ง๋ง, ๊ฐ๋ฐ์ ํ๋ฉด์ export๋ฅผ ๋นผ๋จน์ ํ์ ํ์ผ์ ๋ค๋ฅธ ๊ณณ์์๋ ์ฌ์ฉํ ์ ์๋ ๊ฒ์ ๋ฐ๊ฒฌํ๋ค.
๋๋ฃ๊ฐ ๋ฌผ์ด๋ดค๋๋ฐ, ๋ฐ๋ก ๋๋ต์ ํ์ง๋ชปํด์ ๊ธ๋ก ๋จ๊ธด๋ค.
export๋ฅผ ํ์ง ์์ผ๋ฉด ํด๋น ํ์ผ์ 'Module'์ด ์๋ Script Mode๋ก ์ฒ๋ฆฌ๋์ด ์ ์ญ์์ ์ฌ์ฉ์ด ๊ฐ๋ฅํด์ง๋ค.
๋น์ฐํ ๊ฑฐ ์ผ ์๋ ์์ง๋ง Module System ๋ด์์ export ํน์ import๋ฅผ ํด์ค์ผ ๋ชจ๋๋ก ์ธ์๋๋ค.
In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module. Conversely, a file without any top-level import or export declarations is treated as a script whose contents are available in the global scope(and therefore to modules as well).
https://stackoverflow.com/questions/55488642/what-is-the-difference-between-a-module-and-a-script
What is the difference between a module and a script?
I'm trying to go through typescript documentation to understand modules which are the same as ES6 modules. typescript-modules - documentation for typescript modules. It says that Modules are
stackoverflow.com
'์ค๋ฅ๊ธฐ๋ก' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Yarn & ESLint] Error: Could not find config file (0) | 2024.05.02 |
---|---|
package.json์์ '&&' ์ '&' ์ฐจ์ด (0) | 2024.03.09 |
yarn berry ํ์ ์คํฌ๋ฆฝํธ ์ธ์ ์ค๋ฅ (0) | 2024.03.09 |
[Git] private repository "remote: Repository not found" ์ค๋ฅ (0) | 2023.05.14 |