์ด๋ฒ ์น์ ์ ๋ชจ๋์ ๋ํ ๊ธฐ์ด์ ์ธ ์ง์์ ์ ์ ๋ก ํฉ๋๋ค. ๋ ๋ง์ ์ ๋ณด๋ ๋ชจ๋์ ๋ณด๋๋ก ํ์ธ์.
๋ชจ๋ ํด์ (module resolution) ์ ์ปดํ์ผ๋ฌ๊ฐ import๊ฐ ๋ฌด์์ ์ฐธ์กฐํ๋์ง ์์๋ด๊ธฐ ์ํด ์ฌ์ฉํ๋ ํ๋ก์ธ์ค์
๋๋ค.
import { a } from "moduleA"
๊ฐ์ import ๋ฌธ์ ์๊ฐํด๋ณด์ธ์;
a
์ ๋ชจ๋ ์ฌ์ฉ์ ๊ฒ์ฌํ๊ธฐ ์ํด, ์ปดํ์ผ๋ฌ๋ ๋ฌด์์ ์ฐธ์กฐํ๋์ง ์ ํํ ์์์ผ ํ ํ์๊ฐ ์์ต๋๋ค, ๊ทธ๋ฆฌ๊ณ moduleA
์ ์๋ฅผ ๊ฒ์ฌํด์ผ ํ ํ์๊ฐ ์์ต๋๋ค.
์ด ์์ ์, ์ปดํ์ผ๋ฌ๋ "moduleA
์ ํํ๊ฐ ๋ญ๊น?"๋ผ๊ณ ์ง๋ฌธํ ๊ฒ์
๋๋ค.
๊ฐ๋จํด ๋ณด์ด์ง๋ง, moduleA
๋ .ts
/.tsx
ํ์ผ์ ์ ์๋์ด ์๊ฑฐ๋ ํน์ ์ฝ๋๊ฐ ์์กดํ๋ .d.ts
์ ์ ์๋์ด ์์ ์ ์์ต๋๋ค.
์ฒซ ๋ฒ์งธ๋ก, ์ปดํ์ผ๋ฌ๋ ๊ฐ์ ธ์จ ๋ชจ๋์ ๋ํ๋ด๋ ํ์ผ์ ์์น๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํ ๊ฒ์
๋๋ค.
๊ทธ๋ ๊ฒ ํ๊ธฐ ์ํด ์ปดํ์ผ๋ฌ๋ ๋ ๊ฐ์ง ๋ค๋ฅธ ์ ๋ต ์ค ํ๋๋ฅผ ๋ฐ๋ฆ
๋๋ค: ํด๋์ ํน์ ๋
ธ๋.
์ด ์ ๋ต๋ค์ ์ปดํ์ผ๋ฌ๊ฐ moduleA
๋ฅผ ์ฐพ๊ธฐ ์ํด ์ด๋๋ฅผ ๋ด์ผ ํ ์ง ์๋ ค์ค๋๋ค.
๋ง์ฝ ์ด ๋ฐฉ๋ฒ์ด ์ ์๋๊ณ ๋ชจ๋ ์ด๋ฆ์ด ๋น-์๋์ ์ด๋ผ๋ฉด ("moduleA
์ ๊ฒฝ์ฐ๊ฐ ๊ทธ๋ ์ต๋๋ค), ์ปดํ์ผ๋ฌ๋ ambient ๋ชจ๋ ์ ์ธ์ ์ฐพ์ผ๋ ค๊ณ ํ ๊ฒ์
๋๋ค.
๋น-์๋์ import๋ ๋ค์์ ๋ค๋ฃฐ ๊ฒ์
๋๋ค.
๋ง์ง๋ง์ผ๋ก, ์ปดํ์ผ๋ฌ๊ฐ ๋ชจ๋์ ํด์ํ ์ ์๋ค๋ฉด, ์ค๋ฅ ๋ก๊ทธ๊ฐ ๋ฐ์ํฉ๋๋ค.
์ด ๊ฒฝ์ฐ์, ์ค๋ฅ๋ error TS2307: Cannot find module 'moduleA'
์ ๊ฐ์ต๋๋ค.
๋ชจ๋ ์ฐธ์กฐ๊ฐ ์๋์ ํน์ ๋น-์๋์ ์ด๋์ ๋ฐ๋ผ ๋ชจ๋ import๋ ๋ค๋ฅด๊ฒ ํด์๋ฉ๋๋ค.
์๋์ import ๋ /
, ./
ํน์ ../
. ์ค์ ํ๋๋ก ์์ํฉ๋๋ค.
์ผ๋ถ ์์ ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
import Entry from "./components/Entry";
import { DefaultHeaders } from "../constants/http";
import "/mod";
๋ค๋ฅธ ๋ชจ๋ import๋ ๋น-์๋์ ์ผ๋ก ๊ฐ์ฃผ๋ฉ๋๋ค. ์ผ๋ถ ์์ ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
import * as $ from "jquery";
import { Component } from "@angular/core";
์๋์ import๋ ๊ฐ์ ธ์จ ํ์ผ์ ์๋์ ์ผ๋ก ํด์๋๊ณ ambient ๋ชจ๋ ์ ์ธ์ผ๋ก ํด์ ๋ ์ ์์ต๋๋ค. ์์ ์ ๋ชจ๋์ ๋ํด์๋ ๋ฐํ์์ ์๋์ ์์น๋ฅผ ์ ์งํ๋ ๊ฒ์ ๋ณด์ฅํ๋ ์๋์ import๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
๋น-์๋์ import๋ baseUrl
๋ก ํด์๋๊ฑฐ๋, ๋ฐ์์ ๋ค๋ฃจ๊ฒ ๋ ๊ฒฝ๋ก ๋งคํ์ผ๋ก ํด์๋ ์ ์์ต๋๋ค.
ambient ๋ชจ๋ ์ ์ธ์ผ๋ก๋ ํด์๋ ์ ์์ต๋๋ค.
์ธ๋ถ ์์กด์ฑ์ import ํ ๋, ๋น-์๋์ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ์ธ์.
๋ ๊ฐ์ง ๊ฐ๋ฅํ ๋ชจ๋ ํด์ ์ ๋ต์ด ์์ต๋๋ค: ๋
ธ๋์ ํด๋์.
--moduleResolution
ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ ๋ชจ๋ ํด์ ์ ๋ต์ ์ง์ ํ ์ ์์ต๋๋ค.
์ง์ ๋์ง ์์์ผ๋ฉด, ๋ํดํธ๋ --module AMD | System | ES2015
์์๋ [ํด๋์][#ํด๋์-classic]์ด๊ณ ๋๋จธ์ง๋ ๋
ธ๋์
๋๋ค.
TypeScript์ ๋ํดํธ ํด์ ์ ๋ต์ผ๋ก ์ฌ์ฉ๋ฉ๋๋ค. ์์ฆ์, ์ด ์ ๋ต์ ์ฃผ๋ก ์ด์ ๋ฒ์ ๊ณผ์ ํธํ์ฑ์ ์ํด ์ ๊ณต๋ฉ๋๋ค.
์๋์ import๋ importํ๋ ํ์ผ์ ์๋์ ์ผ๋ก ํด์๋ฉ๋๋ค.
๊ทธ๋์ ์์ค ํ์ผ /root/src/folder/A.ts
์์ import { b } from "./moduleB"`๋ ๋ค์๊ณผ ๊ฐ์ด ์กฐํํฉ๋๋ค:
/root/src/folder/moduleB.ts
/root/src/folder/moduleB.d.ts
๊ทธ๋ฌ๋, ๋น-์๋์ ๋ชจ๋ import์์๋, ์ปดํ์ผ๋ฌ๊ฐ ๊ฐ์ ธ์จ ํ์ผ์ ๊ฐ๊ณ ์๋ ๋๋ ํฐ๋ฆฌ๋ถํฐ ์์ํด์ ๋๋ ํฐ๋ฆฌ ํธ๋ฆฌ๋ฅผ ๊ฑฐ์ฌ๋ฌ ์ฌ๋ผ๊ฐ ๋ง๋ ์ ์ ํ์ผ์ ์์น๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํฉ๋๋ค.
์๋ฅผ ๋ค์ด:
์์ค ํ์ผ /root/src/folder/A.ts
์์ import { b } from "moduleB"
์ฒ๋ผ moduleB
์ ๋น-์๋์ import์ "moduleB"
์ ์์น๋ฅผ ์ฐพ๊ธฐ ์ํด ๋ค์๊ณผ ๊ฐ์ ์์น๋ฅผ ์ฐพ์ต๋๋ค.
/root/src/folder/moduleB.ts
/root/src/folder/moduleB.d.ts
/root/src/moduleB.ts
/root/src/moduleB.d.ts
/root/moduleB.ts
/root/moduleB.d.ts
/moduleB.ts
/moduleB.d.ts
์ด ํด์ ์ ๋ต์ ๋ฐํ์์ Node.js์ ๋ชจ๋ ํด์ ๋ฉ์ปค๋์ฆ์ ๋ชจ๋ฐฉํ๋ ค๊ณ ์๋ํฉ๋๋ค. ์ ์ฒด Node.js ํด์ ์๊ณ ๋ฆฌ์ฆ์ Node.js ๋ชจ๋ ๋ฌธ์์ ์์ฝ๋์ด ์์ต๋๋ค.
TS ์ปดํ์ผ๋ฌ๊ฐ ์ด๋ค ๊ณผ์ ์ ๋ฐ๋ฅผ์ง ์ดํดํ๊ธฐ ์ํด์๋, Node.js ๋ชจ๋์ ์ดํดํ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค.
์ ํต์ ์ผ๋ก, Node.js์ import๋ require
ํจ์๋ฅผ ํธ์ถํด ์ํํฉ๋๋ค.
Node.js์ ๋์์ require
์ ์๋์ ๊ฒฝ๋ก ํน์ ๋น-์๋์ ๊ฒฝ๋ก๊ฐ ์ฃผ์ด์ง๋์ง์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋๋ค.
์๋์ ๊ฒฝ๋ก๋ ์์ฃผ ๊ฐ๋จํฉ๋๋ค.
์๋ฅผ ๋ค์ด, var x = require("./moduleB");
๋ผ๋ import ๋ฌธ์ ํฌํจํ /root/src/moduleA.js
์ ์์นํ ํ์ผ์ ์๊ฐํด๋ด
์๋ค.
Node.js๋ ๋ค์ ์์๋ก import๋ฅผ ํด์ํฉ๋๋ค:
-
/root/src/moduleB.js
๋ผ๋ ํ์ผ์ด ์กด์ฌํ๋์ง ํ์ธ. -
๋ง์ฝ
"main"
๋ชจ๋์ ์ง์ ํ๋package.json
๋ผ๋ ํ์ผ์ ํฌํจํ๊ณ ์์ผ๋ฉด,/root/src/moduleB
ํด๋ ํ์ธํ๊ธฐ. ์ด ์์ ์์๋, ๋ง์ฝ Node.js๊ฐ{ "main": "lib/mainModule.js" }
์ ํฌํจํ๋/root/src/moduleB/package.json
ํ์ผ์ ์ฐพ์๋ค๋ฉด, Node.js๊ฐ/root/src/moduleB/lib/mainModule.js
๋ฅผ ์ฐธ์กฐํ ๊ฒ์ ๋๋ค. -
index.js
๋ผ๋ ํ์ผ์ ํฌํจํ๊ณ ์์ผ๋ฉด,/root/src/moduleB
ํ์ธํ๊ธฐ. ์ด ํ์ผ์ ํด๋์ "main" ๋ชจ๋์์ ์์์ ์ผ๋ก ๋ํ๋ ๋๋ค.
์์ธํ ๋ด์ฉ์ Node.js ๋ฌธ์ ํ์ผ ๋ชจ๋๊ณผ ํด๋ ๋ชจ๋์์ ๋ ์ฝ์ด๋ณด์ค ์ ์์ต๋๋ค.
๊ทธ๋ฌ๋, ๋น-์๋์ ๋ชจ๋ ์ด๋ฆ์ ๋ํ ํด์์ ๋ค๋ฅด๊ฒ ์ํํฉ๋๋ค.
Node๋ node_modules
๋ก ๋ถ๋ฆฌ๋ ํน๋ณํ ํด๋์์ ๋ชจ๋์ ์ฐพ์ ๊ฒ์
๋๋ค.
node_modules
ํด๋๋ ํ์ฌ ํ์ผ๊ณผ ๋์ผํ ๋ ๋ฒจ์ด๊ฑฐ๋, ๋๋ ํฐ๋ฆฌ ์ฒด์ธ์์ ๋ ๋์ ์๋ ์์ต๋๋ค.
Node๋ ๋๋ ํฐ๋ฆฌ ์ฒด์ธ์ ์ฌ๋ผ๊ฐ, ๋ก๋ํ๋ ค๋ ๋ชจ๋์ ์ฐพ์ ๋๊น์ง ๊ฐ node_modules
์ ์ฐพ์ต๋๋ค.
์์ ์์ ๋ฅผ ๋ฐ๋ผ์, /root/src/moduleA.js
๊ฐ ๋์ ๋น-์๋์ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ๊ณ var x = require("moduleB");
import๋ฅผ ๊ฐ์ง๊ณ ์๋ค๊ณ ์๊ฐํด๋ด
์๋ค.
Node๋ ํ๋๊ฐ ์ผ์นํ ๋๊น์ง ๊ฐ ์์น์์ moduleB
๋ฅผ ํด์ํ๋ ค๊ณ ์๋ํฉ๋๋ค.
/root/src/node_modules/moduleB.js
/root/src/node_modules/moduleB/package.json
("main"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/root/src/node_modules/moduleB/index.js
/root/node_modules/moduleB.js
/root/node_modules/moduleB/package.json
("main"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/root/node_modules/moduleB/index.js
/node_modules/moduleB.js
/node_modules/moduleB/package.json
("main"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/node_modules/moduleB/index.js
Node.js๊ฐ (4) ์ (7)์์ ๋๋ ํฐ๋ฆฌ๋ฅผ ์ ํํ๋ค๋ ๊ฒ์ ์ฃผ๋ชฉํ์ธ์.
ํ๋ก์ธ์ค์ ๋ํ ๋ ๋ง์ ์ ๋ณด๋ Node.js ๋ฌธ์ node_modules
์์ ๋ชจ๋ ๋ก๋ํ๊ธฐ์์ ์ฝ์ด๋ณด์ค ์ ์์ต๋๋ค.
TypeScript๋ ์ปดํ์ผ-ํ์์ ๋ชจ๋์ ์ ์ ํ์ผ ์์น๋ฅผ ์ฐพ๊ธฐ ์ํด Node.js์ ๋ฐํ์ ํด์ ์ ๋ต์ ๋ชจ๋ฐฉํฉ๋๋ค.
์ด๋ฅผ ๋ฌ์ฑํ๊ธฐ ์ํด, TypeScript๋ TypeScript ์์ค ํ์ผ ํ์ฅ์ (.ts
, .tsx
์ .d.ts
)๋ฅผ Node์ ํด์ ๋ก์ง ์์ ์์๋๋ค.
TypeScript๋ "main"
์ ๋ชฉ์ - ์ปดํ์ผ๋ฌ๊ฐ ์ด๋ฅผ ์ฌ์ฉํ์ฌ ์ฐธ์กฐํ "main" ์ ์ ํ์ผ์ ์ฐพ์. ์ ๋ฐ์ํ๊ธฐ ์ํด "types"
๋ผ๋ package.json
์์ ํ๋๋ฅผ ์ฌ์ฉํฉ๋๋ค
์๋ฅผ ๋ค์ด, /root/src/moduleA.ts
์์ import { b } from "./moduleB"
๊ฐ์ import ๋ฌธ์ "./moduleB"
์ ์์น๋ฅผ ์ฐพ๊ธฐ ์ํด ๋ค์๊ณผ ๊ฐ์ ์์น๋ฅผ ์ฐพ์ต๋๋ค.
/root/src/moduleB.ts
/root/src/moduleB.tsx
/root/src/moduleB.d.ts
/root/src/moduleB/package.json
("types"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/root/src/moduleB/index.ts
/root/src/moduleB/index.tsx
/root/src/moduleB/index.d.ts
Node.js๊ฐ moduleB.js
ํ์ผ์ ์ฐพ๊ณ ๋์, ํด๋นํ๋ package.json
์ ์ฐพ๊ณ , index.js
๋ฅผ ์ฐพ์๋ค๋ ๊ฒ์ ์๊ธฐํด๋ด
์๋ค.
๋น์ทํ๊ฒ, ๋น-์๋์ import๋ Node.js ํด์ ๋ก์ง์ ๋ฐ๋ฆ
๋๋ค, ์ฒซ ๋ฒ์งธ๋ก ํ์ผ์ ์ฐพ๊ณ , ๊ทธ๋ฌ๊ณ ๋์ ํด๋นํ๋ ํด๋๋ฅผ ์ฐพ์ต๋๋ค.
๊ทธ๋์ /root/src/moduleA.ts
์์ค ํ์ผ ์์ import { b } from "moduleB"
๋ ๋ค์๊ณผ ๊ฐ์ ์กฐํ๋ฅผ ํฉ๋๋ค.
/root/src/node_modules/moduleB.ts
/root/src/node_modules/moduleB.tsx
/root/src/node_modules/moduleB.d.ts
/root/src/node_modules/moduleB/package.json
("types"
ํ๋กํผํฐ๋ฅผ ์ง์ ํ๋ค๋ฉด)/root/src/node_modules/@types/moduleB.d.ts
/root/src/node_modules/moduleB/index.ts
/root/src/node_modules/moduleB/index.tsx
/root/src/node_modules/moduleB/index.d.ts
/root/node_modules/moduleB.ts
/root/node_modules/moduleB.tsx
/root/node_modules/moduleB.d.ts
/root/node_modules/moduleB/package.json
("types"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/root/node_modules/@types/moduleB.d.ts
/root/node_modules/moduleB/index.ts
/root/node_modules/moduleB/index.tsx
/root/node_modules/moduleB/index.d.ts
/node_modules/moduleB.ts
/node_modules/moduleB.tsx
/node_modules/moduleB.d.ts
/node_modules/moduleB/package.json
("types"
ํญ๋ชฉ์ ์ง์ ํ๋ค๋ฉด)/node_modules/@types/moduleB.d.ts
/node_modules/moduleB/index.ts
/node_modules/moduleB/index.tsx
/node_modules/moduleB/index.d.ts
์คํ ์ ๋๋ฌธ์ ๋๋ ค์ํ์ง ๋ง์ธ์ - TypeScript๊ฐ ์ฌ์ ํ ๋๋ ํฐ๋ฆฌ๋ฅผ (9)์ (17)์์ ๋ ๋ฒ ์ ํํฉ๋๋ค.
Node.js๊ฐ ํ๋ ๊ฒ๋ณด๋ค ๋ ๋ณต์กํ์ง ์์ต๋๋ค.
ํ๋ก์ ํธ ์์ค ๋ ์ด์์์ด ์ถ๋ ฅ๊ณผ ์ผ์นํ์ง ์์ ๋๋ ์์ต๋๋ค.
์ผ๋ฐ์ ์ผ๋ก ์ผ๋ จ์ ๋น๋ ์คํ
์ด ์์ฑ๋ ์ต์ข
์ถ๋ ฅ์ ๋ง๋ญ๋๋ค.
.ts
ํ์ผ์ .js
๋ก ์ปดํ์ผํ๊ณ , ๋ค๋ฅธ ์์ค ์์น์์ ํ๋์ ์ถ๋ ฅ ์์น๋ก ์์กด์ฑ์ ๋ณต์ฌํ๋ ๊ฒ์ ํฌํจํฉ๋๋ค.
์ต์ข
๊ฒฐ๊ณผ๋ ๋ฐํ์์ ๋ชจ๋์ด ํด๋น ์ ์๋ฅผ ํฌํจํ๋ ์์ค ํ์ผ๊ณผ ๋ค๋ฅธ ์ด๋ฆ์ ๊ฐ์ง ์ ์๋ค๋ ๊ฒ์ด๋ค.
ํน์ ์ต์ข
์ถ๋ ฅ์ ๋ชจ๋ ๊ฒฝ๋ก๊ฐ ์ปดํ์ผ ํ์์ ํด๋นํ๋ ์์ค ํ์ผ ๊ฒฝ๋ก์ ์ผ์นํ์ง ์์ ์ ์์ต๋๋ค.
TypeScript ์ปดํ์ผ๋ฌ๋ ์ถ๊ฐ ํ๋๊ทธ๋ฅผ ๊ฐ๊ณ ์์ต๋๋ค. The TypeScript compiler has a set of additional flags to inform the compiler of transformations that are expected to happen to the sources to generate the final output. TypeScript ์ปดํ์ผ๋ฌ๋ ์ต์ข ์ถ๋ ฅ์ ์์ฑํ๊ธฐ์ํด ์์ค์ ๋ฐ์ํ ๊ฒ์ผ๋ก ์์๋๋ ๋ณํ์ ์ปดํ์ผ๋ฌ์๊ฒ ์๋ฆฌ๊ธฐ ์ํ ์ถ๊ฐ ํ๋๊ทธ ์ธํธ๊ฐ ์์ต๋๋ค.
์ปดํ์ผ๋ฌ๊ฐ ์ด๋ฌํ ๋ณํ๋ ์ํํ์ง ์๋ ๋ค๋ ๊ฒ์ ์ ์ํ์ญ์์ค; ์ ์ ํ์ผ๋ก ๋ชจ๋ import๋ฅผ ํด์ํ๋ ๊ณผ์ ์ ์๋ดํ๊ธฐ ์ํด ์ด๋ฌํ ์ ๋ณด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
baseUrl
์ ์ฌ์ฉํ๋ ๊ฒ์ ๋ชจ๋๋ค์ด ๋ฐํ์์ ๋จ์ผ ํด๋๋ก "๋ฐฐํฌ"๋๋ AMD ๋ชจ๋ ๋ก๋๋ฅผ ์ฌ์ฉํ๋ ์ ํ๋ฆฌ์ผ์ด์
์์ ์ผ๋ฐ์ ์ธ ๋ฐฉ๋ฒ์
๋๋ค.
์ด ๋ชจ๋๋ค์ ์์ค๋ ๋ค๋ฅธ ๋๋ ํฐ๋ฆฌ ์์ ์์ ์ ์์ง๋ง, ๋น๋ ์คํฌ๋ฆฝํธ๊ฐ ๋ชจ๋ ํ๋๋ก ๋ง๋ค ๊ฒ์
๋๋ค.
baseUrl
์ ์ค์ ํ๋ ๊ฒ์ ์ปดํ์ผ๋ฌ์๊ฒ ์ด๋์์ ๋ชจ๋์ ์ฐพ์์ง ์๋ ค์ฃผ๋ ๊ฒ์
๋๋ค.
๋ชจ๋ ๋น-์๋์ ์ด๋ฆ์ ๋ชจ๋ import๋ baseUrl
์ ์๋์ ์ด๋ผ๊ณ ๊ฐ์ ํฉ๋๋ค.
baseUrl์ ๊ฐ์ ๋ค์ ์ค ํ๋๋ก ๊ฒฐ์ ๋ฉ๋๋ค:
- baseUrl ๋ช ๋ น ์ค ์ธ์ ๊ฐ (๋ง์ฝ ์ฃผ์ด์ง ๊ฒฝ๋ก๊ฐ ์๋์ ์ด๋ฉด, ํ์ฌ ๋๋ ํฐ๋ฆฌ๋ฅผ ๊ธฐ์ค์ผ๋ก ๊ณ์ฐ๋จ)
- 'tsconfig.json'์์ baseUrl ํ๋กํผํฐ ๊ฐ (๋ง์ฝ ์ฃผ์ด์ง ๊ฒฝ๋ก๊ฐ ์๋์ ์ด๋ฉด, 'tsconfig.json'์ ์์น๋ฅผ ๊ธฐ์ค์ผ๋ก ๊ณ์ฐ๋จ)
์๋์ ๋ชจ๋ import๋ ํญ์ ๊ฐ์ ธ์จ ํ์ผ์ ์๋์ ์ผ๋ก ํด์๋๊ธฐ ๋๋ฌธ์, baseUrl์ ์ค์ ํ๋ ๊ฒ์ ์ํฅ์ ๋ฐ์ง ์๋ ์ ์ ์ ์ํ์ญ์์ค.
baseUrl์ ๋ํ ๋ ๋ง์ ๋ฌธ์๋ RequireJS์ SystemJS ๋ฌธ์์์ ์ฐพ์ผ์ค ์ ์์ต๋๋ค.
๊ฐ๋ ๋ชจ๋์ด baseUrl ์๋์ ์์นํ์ง ์๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, "jquery"
๋ชจ๋์ import๋ ๋ฐํ์์ "node_modules/jquery/dist/jquery.slim.min.js"
๋ก ๋ฒ์ญ๋ฉ๋๋ค.
๋ก๋๋ ๋ฐํ์์ ๋ชจ๋ ์ด๋ฆ์ ํ์ผ์ ๋งคํํ๊ธฐ ์ํด ๋งคํ ๊ตฌ์ฑ์ ์ฌ์ฉํฉ๋๋ค, RequireJs ๋ฌธ์์ SystemJS ๋ฌธ์๋ฅผ ๋ณด์ธ์.
TypeScript ์ปดํ์ผ๋ฌ๋ tsconfig.json
ํ์ผ ์์ "paths"
ํ๋กํผํฐ๋ฅผ ์ฌ์ฉํ ๋งคํ์ ์ ์ธ์ ์ง์ํฉ๋๋ค.
jquery
๋ฅผ ์ํ "paths"
ํ๋กํผํฐ๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ ๊ฐ ์์ต๋๋ค.
{
"compilerOptions": {
"baseUrl": ".", // "paths"๊ฐ ์๋ ๊ฒฝ์ฐ ๋ฐ๋์ ์ง์ ๋์ด์ผํจ.
"paths": {
"jquery": ["node_modules/jquery/dist/jquery"] // ์ด ๋งคํ์ "baseUrl"์ ์๋์ ์.
}
}
}
"paths"
๊ฐ "baseUrl"
์ ์๋์ ์ผ๋ก ํด์๋๋ค๋ ์ ์ ์ฃผ๋ชฉํ์ธ์.
"baseUrl"
์ "."
๊ฐ ์๋ ๋ค๋ฅธ ๊ฐ, ์ tsconfig.json
์ ๋๋ ํฐ๋ฆฌ,์ผ๋ก ์ค์ ํ๋ฉด, ๊ทธ์ ๋ฐ๋ผ ๋งคํ๋ ๋ฐ๋๋๋ค.
๋ง์ฝ ์ ์์ ์์ "baseUrl": "./src" ๋ก ์ค์ ํ๋ค๋ฉด, jquery๋ "../node_modules/jquery/dist/jquery" ๋ก ๋งคํ๋์ด์ผ ํฉ๋๋ค.
"paths"
๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ์ฌ๋ฌ ๊ฐ์ ์ด์ ์์น๋ฅผ ํฌํจํ ์ ๊ตํ ๋งคํ์ด ๊ฐ๋ฅํฉ๋๋ค.
์ผ๋ถ ๋ชจ๋๋ง ํ ์์น์์ ์ฌ์ฉ ๊ฐ๋ฅํ๊ณ , ๋๋จธ์ง๋ ๋ค๋ฅธ ๊ณณ์ ์๋ ํ๋ก์ ํธ ๊ตฌ์ฑ์ ์๊ฐํด๋ณด์ธ์.
๋น๋ ์คํ
์ด ํ๊ณณ์ผ๋ก ๋ชจ์ ๊ฒ์
๋๋ค.
ํ๋ก์ ํธ์ ๋ ์ด์์์ ๋ค์๊ณผ ๊ฐ์ด ๋ณด์
๋๋ค:
projectRoot
โโโ folder1
โ โโโ file1.ts (imports 'folder1/file2' and 'folder2/file3')
โ โโโ file2.ts
โโโ generated
โ โโโ folder1
โ โโโ folder2
โ โโโ file3.ts
โโโ tsconfig.json
tsconfig.json
๋ ๋ค์๊ณผ ๊ฐ์ด ๋ณด์ผ ๊ฒ์
๋๋ค:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [
"*",
"generated/*"
]
}
}
}
์ด๋ ์ปดํ์ผ๋ฌ์๊ฒ ๋ ์์น์์ ํจํด "*"
(i.e. ๋ชจ๋ ๊ฐ) ๊ณผ ์ผ์นํ๋ ๋ชจ๋ ๋ชจ๋ import๋ฅผ ์๋ ค์ค๋๋ค
"*"
: ๊ฐ์ ์ด๋ฆ์ ๋ฐ๋์ง ์์์ ์๋ฏธ, ๊ทธ๋์<moduleName>
=><baseUrl>/<moduleName>
์ผ๋ก ๋งคํ"generated/*"
์ ๋์ฌ "generated"๊ฐ ์ถ๊ฐ๋ ๋ชจ๋ ์ด๋ฆ์ ์๋ฏธ, ๊ทธ๋์<moduleName>
=><baseUrl>/generated/<moduleName>
๋ก ๋งคํ
์ด ๋ก์ง์ ๋ฐ๋ฅด๋ฉด, ์ปดํ์ผ๋ฌ๋ ๋ค์๊ณผ ๊ฐ์ ๋ ๊ฐ์ง import๋ฅผ ํด์ํ๋ ค๊ณ ํ ๊ฒ์ ๋๋ค:
import 'folder1/file2':
- ๋ชจ๋ '*'์ ์ผ์นํ๊ณ ์์ผ๋์นด๋๊ฐ ์ ์ฒด ๋ชจ๋ ์ด๋ฆ์ ์บก์ฒํจ
- ๋ชฉ๋ก์์ ์ฒซ ๋ฒ์งธ ๋์ฒด ์๋: '*' ->
folder1/file2
- ๋์ฒด์ ๊ฒฐ๊ณผ๊ฐ ๋น-์๋์ ์ด๋ฆ - baseUrl๊ณผ ๊ฒฐํฉ ->
projectRoot/folder1/file2.ts
- ํ์ผ์ด ์กด์ฌ. ์๋ฃ.
import 'folder2/file3':
- ๋ชจ๋ '*'์ ์ผ์นํ๊ณ ์์ผ๋์นด๋๊ฐ ์ ์ฒด ๋ชจ๋ ์ด๋ฆ์ ์บก์ฒํจ
- ๋ชฉ๋ก์์ ์ฒซ ๋ฒ์งธ ๋์ฒด ์๋: '*' ->
folder2/file3
- ๋์ฒด์ ๊ฒฐ๊ณผ๊ฐ ๋น-์๋์ ์ด๋ฆ - baseUrl๊ณผ ๊ฒฐํฉ ->
projectRoot/folder2/file3.ts
- ํ์ผ์ด ์กด์ฌํ์ง ์์, ๋ ๋ฒ์งธ ๋์ฒด๋ก ์ด๋
- ๋ ๋ฒ์งธ ๋์ฒด 'generated/*' ->
generated/folder2/file3
- ๋์ฒด์ ๊ฒฐ๊ณผ๊ฐ ๋น-์๋์ ์ด๋ฆ - baseUrl๊ณผ ๊ฒฐํฉ ->
projectRoot/generated/folder2/file3.ts
- ํ์ผ์ด ์กด์ฌ. ์๋ฃ.
๋๋๋ก ์ปดํ์ผ ํ์์ ์ฌ๋ฌ ๋๋ ํฐ๋ฆฌ์ ํ๋ก์ ํธ ์์ค๊ฐ ๋ชจ๋ ๊ฒฐํฉ๋์ด ๋จ์ผ ์ถ๋ ฅ ๋๋ ํฐ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค. ์ฌ๋ฌ ์์ค ๋๋ ํฐ๋ฆฌ๊ฐ "๊ฐ์" ๋๋ ํฐ๋ฆฌ๋ฅผ ์์ฑํ๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
'rootDirs'๋ฅผ ์ฌ์ฉํ๋ฉด, ์ปดํ์ผ๋ฌ์๊ฒ ์ด "๊ฐ์" ๋๋ ํฐ๋ฆฌ๋ฅผ ๊ตฌ์ฑํ๋ roots๋ฅผ ์๋ฆด ์ ์์ต๋๋ค; ๋ฐ๋ผ์ ์ปดํ์ผ๋ฌ๋ ์ด๋ฌํ "๊ฐ์"๋๋ ํฐ๋ฆฌ ๋ด์์ ์๋์ ๋ชจ๋ import๋ฅผ ๋ง์น ํ๋์ ๋๋ ํฐ๋ฆฌ์ ๊ฐ์ด ๋ณํฉ ํ ๊ฒ์ฒ๋ผ ํด์ํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด ์ด ํ๋ก์ ํธ ๊ตฌ์กฐ๋ฅผ ์๊ฐํด๋ณด์ธ์:
src
โโโ views
โโโ view1.ts (imports './template1')
โโโ view2.ts
generated
โโโ templates
โโโ views
โโโ template1.ts (imports './view2')
src/views
์์ ํ์ผ๋ค์ UI ์ปจํธ๋กค์ ์ํ ์ ์ ์ฝ๋์
๋๋ค.
generated/templated
์์ ํ์ผ๋ค์, ๋น๋์ ์ผ๋ถ๋ก์จ ํ
ํ๋ฆฟ ์์ฑ๊ธฐ์ ์ํด ์๋-์์ฑ๋ UI ํ
ํ๋ฆฟ ๋ฐ์ธ๋ฉ ์ฝ๋์
๋๋ค.
๋น๋ ์คํ
์ /src/view
์ /generated/templates/views
๋ฅผ ์ถ๋ ฅ์์ ๊ฐ์ ๋๋ ํฐ๋ฆฌ๋ก ๋ณต์ฌํฉ๋๋ค.
๋ฐํ์์์, ๋ทฐ๋ ํ
ํ๋ฆฟ์ด ์์ ์๋ค๊ณ ๊ธฐ๋ํ ๊ฒ์ด๊ธฐ ๋๋ฌธ์, "./template"
์ฒ๋ผ ์๋์ ์ธ ์ด๋ฆ์ import์์ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์ปดํ์ผ๋ฌ์๊ฒ ์ด ๊ด๊ณ๋ฅผ ์ง์ ํ๊ธฐ ์ํด์, "rootDirs"
๋ฅผ ์ฌ์ฉํฉ๋๋ค.
"rootDirs"
๋ ๋ด์ฉ๋ฌผ์ด ๋ฐํ์์ ๋ณํฉํ ๊ฒ์ผ๋ก ์์๋๋ roots ์ ๋ชฉ๋ก์ ์ง์ ํฉ๋๋ค.
๊ทธ๋์ ๋ค์์ ์์ ์์, tsconfig.json
ํ์ผ์ ๋ค์๊ณผ ๊ฐ์์ผ ํฉ๋๋ค:
{
"compilerOptions": {
"rootDirs": [
"src/views",
"generated/templates/views"
]
}
}
์ปดํ์ผ๋ฌ๊ฐ rootDirs
์ค ํ๋์ ํ์ ํด๋์์ ์๋์ ๋ชจ๋ import๋ฅผ ๋ณผ ๋๋ง๋ค, ๊ฐ rootDirs
์ ์ํธ๋ฆฌ์์ ์ด import๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํ ๊ฒ์
๋๋ค.
rootDirs
์ ์ ์ฐํจ์ ๋
ผ๋ฆฌ์ ์ผ๋ก ๋ณํฉ๋๋ ๋ฌผ๋ฆฌ์ ์์ค ๋๋ ํฐ๋ฆฌ์ ๋ชฉ๋ก์ ์ง์ ํ๋๋ฐ ์ ํ๋์ง ์์ต๋๋ค. ์ ๊ณต๋๋ ๋ฐฐ์ด์ ์๋ง ์กด์ฌ ์ฌ๋ถ์ ๊ด๊ณ์์ด ์์์ ์์ ad hoc, ์์์ ๋๋ ํฐ๋ฆฌ ์ด๋ฆ์ ํฌํจํ ์ ์์ต๋๋ค. ์ด๋ ์ปดํ์ผ๋ฌ์๊ฒ ์กฐ๊ฑด๋ถ ํฌํจ๊ณผ ํ๋ก์ ํธ ์ ์ฉ ๋ก๋ ํ๋ฌ๊ทธ์ธ๊ณผ ๊ฐ์ ๋ณต์กํ ๋ฒ๋ค๋ง๊ณผ ๋ฐํ์ ๊ธฐ๋ฅ์ ์์ ํ ๋ฐฉ๋ฒ์ผ๋ก ์บก์ฒํ ์ ์๊ฒ ํด์ค๋๋ค.
./#{locale}/messages
์ ๊ฐ์ ์๋ ๋ชจ๋ ๊ฒฝ๋ก์ ์ผ๋ถ๋ก #{locale}
์ ๊ฐ์ ํน์ ๊ฒฝ๋ก ํ ํฐ์ ๋ณด๊ฐํ์ฌ ๋น๋ ํด์ด ๋ก์ผ์ผ ์ ์ฉ ๋ฒ๋ค์ ์๋์ผ๋ก ์์ฑํ๋ ๊ตญ์ ํ ์๋๋ฆฌ์ค๋ฅผ ๊ณ ๋ คํด๋ด
์๋ค. ์ด ๊ฐ์์ ์ค์ ์์ ํด์ด ์ง์ํ๋ ๋ก์ผ์ผ์ ์ด๊ฑฐํ๊ณ , ์ถ์ ๊ฒฝ๋ก๋ฅผ ./zh/messages
, ./de/messages
๋ฑ์ผ๋ก ๋งคํ ํฉ๋๋ค.
๊ฐ ๋ชจ๋์ ๋ฌธ์์ด ๋ฐฐ์ด์ export ํ๋ค๊ณ ๊ฐ์ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด ./zh/messages
๋ ๋ค์์ ํฌํจํฉ๋๋ค:
export default [
"ๆจๅฅฝๅ",
"ๅพ้ซๅ
ด่ฎค่ฏไฝ "
];
rootDirs
๋ฅผ ํ์ฉํ์ฌ ์ปดํ์ผ๋ฌ์๊ฒ ์ด ๋งคํ์ ๋ํด ์๋ ค์ฃผ์ด ์ฌ์ง์ด ๋๋ ํฐ๋ฆฌ๊ฐ ์กด์ฌํ์ง ์์๋ ์์ ํ๊ฒ ./#{locale}/messages
๋ฅผ ํด์ํ ์ ์๋๋ก ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ๋ค์๊ณผ ๊ฐ์ tsconfig.json
๋ฅผ ๋ณด์ญ์์ค:
{
"compilerOptions": {
"rootDirs": [
"src/zh",
"src/de",
"src/#{locale}"
]
}
}
์ปดํ์ผ๋ฌ๋ ์ด์ './#{locale}/messages'๋ฅผ './zh/messages'
๋ก ํด์ํ์ฌ ์ค๊ณ ์๊ฐ ์ง์์ ํํํ์ง ์๊ณ ๋ก์ผ์ผ์ ๊ด๊ณ์๋ ๋ฐฉ๋ฒ์ผ๋ก ๊ฐ๋ฐํ ์ ์์ต๋๋ค.
์์์ ๋ ผ์ํ ๋ฐ์ ๊ฐ์ด ์ปดํ์ผ๋ฌ๋ ๋ชจ๋์ ํด์ํ ๋ ํ์ฌ ํด๋ ์ธ๋ถ์ ํ์ผ์ ๋ฐฉ๋ฌธํ ์ ์์ต๋๋ค. ์ด๋ ๋ชจ๋์ด ํด์๋์ง ์๊ฑฐ๋ ์๋ชป๋ ์ ์๋ก ํด์๋ ์ด์ ๋ฅผ ์ง๋จํ ๋ ์ด๋ ค์ธ ์ ์์ต๋๋ค. '--traceResolution'์ ์ฌ์ฉํ์ฌ ์ปดํ์ผ๋ฌ ๋ชจ๋ ํด์ ์ถ์ ์ ํ์ฑํํ๋ฉด ๋ชจ๋ ํด์ ๊ณผ์ ์ค์ ๋ฐ์ํ ์์ ์ ๋ํ ์ธ์ฌ์ดํธ๋ฅผ ์ป์ ์ ์์ต๋๋ค.
typescript
๋ชจ๋์ ์ฌ์ฉํ๋ ์์ ์ ํ๋ฆฌ์ผ์ด์
์ด ์๋ค๊ณ ํด๋ด
์๋ค.
app.ts
๋ import * as ts from "typescript"
๊ฐ์ import๊ฐ ์์ต๋๋ค.
โ tsconfig.json
โโโโnode_modules
โ โโโโtypescript
โ โโโโlib
โ typescript.d.ts
โโโโsrc
app.ts
--traceResolution
์ผ๋ก ์ปดํ์ผ๋ฌ๋ฅผ ํธ์ถ
tsc --traceResolution
๋ค์๊ณผ ๊ฐ์ ์ถ๋ ฅ์ด ๋ฐ์:
======== Resolving module 'typescript' from 'src/app.ts'. ========
Module resolution kind is not specified, using 'NodeJs'.
Loading module 'typescript' from 'node_modules' folder.
File 'src/node_modules/typescript.ts' does not exist.
File 'src/node_modules/typescript.tsx' does not exist.
File 'src/node_modules/typescript.d.ts' does not exist.
File 'src/node_modules/typescript/package.json' does not exist.
File 'node_modules/typescript.ts' does not exist.
File 'node_modules/typescript.tsx' does not exist.
File 'node_modules/typescript.d.ts' does not exist.
Found 'package.json' at 'node_modules/typescript/package.json'.
'package.json' has 'types' field './lib/typescript.d.ts' that references 'node_modules/typescript/lib/typescript.d.ts'.
File 'node_modules/typescript/lib/typescript.d.ts' exist - use it as a module resolution result.
======== Module name 'typescript' was successfully resolved to 'node_modules/typescript/lib/typescript.d.ts'. ========
- import์ ์ด๋ฆ๊ณผ ์์น
======== 'src/app.ts' ์์ 'typesciprt' ๋ชจ๋ ํด์. ========
- ์ปดํ์ผ๋ฌ๊ฐ ๋ฐ๋ฅด๋ ์ ๋ต
๋ชจ๋ ํด์ ์ข ๋ฅ๊ฐ ์ง์ ๋์ง ์์ผ๋ฉด, 'NodeJs ์ฌ์ฉ.
- npm ํจํค์ง์์ types ๋ก๋ฉ
'package.json'์ 'node_modules/typescript/lib/typescript.d.ts'๋ฅผ ์ฐธ์กฐํ๋ 'types' ํ๋ './lib/typescript.d.ts'๊ฐ ์์ต๋๋ค.
- ์ต์ข ๊ฒฐ๊ณผ
======== ๋ชจ๋ ์ด๋ฆ 'typescript'๋ 'node_modules/typescript/lib/typescript.d.ts'๋ก ์ฑ๊ณต์ ์ผ๋ก ํด์ ๋์์ต๋๋ค. ========
์ผ๋ฐ์ ์ผ๋ก ์ปดํ์ผ๋ฌ๋ ์ปดํ์ผ ๊ณผ์ ์ ์์ํ๊ธฐ ์ ์ ๋ชจ๋ ๋ชจ๋ import๋ฅผ ํด์ํ๋ ค๊ณ ํฉ๋๋ค.
ํ์ผ์ import
๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ํด์ํ ๋๋ง๋ค, ํ์ผ์ ๋์ค์ ์ปดํ์ผ๋ฌ๊ฐ ์ฒ๋ฆฌํ ํ์ผ ์ธํธ์ ์ถ๊ฐ๋ฉ๋๋ค.
--noResolve
์ปดํ์ผ๋ฌ ์ต์
์ ๋ช
๋ น ์ค์ ์ ๋ฌํ์ง ์์ ํ์ผ์ ์ปดํ์ผ์ "์ถ๊ฐ" ํ์ง ์๋๋ก ์ง์ํฉ๋๋ค.
์ฌ์ ํ ํ์ผ์ ๋ชจ๋์ ํด์ํ๋ ค๊ณ ํ์ง๋ง, ํ์ผ์ด ์ง์ ๋์ง ์์์ผ๋ฉด, ๊ทธ ํ์ผ์ ํฌํจํ์ง ์์ต๋๋ค.
์๋ฅผ ๋ค์ด:
import * as A from "moduleA" // ์ฑ๊ณต, 'moduleA'๊ฐ ๋ช
๋ น์ค๋ก ์ ๋ฌ๋จ
import * as B from "moduleB" // Error TS2307: Cannot find module 'moduleB.
tsc app.ts moduleA.ts --noResolve
--noResolve
๋ฅผ ์ฌ์ฉํ app.ts
์ ์ปดํ์ผ์ ๋ค์๊ณผ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋์ต๋๋ค:
- ๋ช
๋ น ์ค๋ก ์ ๋ฌํ๊ธฐ ๋๋ฌธ์
moduleA
๋ ์ ํํ๊ฒ ์ฐพ์. - ์ ๋ฌํ์ง ์์๊ธฐ ๋๋ฌธ์
moduleB
๋ฅผ ์ฐพ๋๋ฐ ์คํจํจ.
์ ์ธ ๋ชฉ๋ก์ ์๋ ๋ชจ๋์ ์ฌ์ ํ ์ปดํ์ผ๋ฌ๊ฐ ์ ํํ๋ ์ด์ ๋ ๋ฌด์์ธ๊ฐ? (Why does a module in the exclude list still get picked up by the compiler?)
tsconfig.json
์ ํด๋๋ฅผ "ํ๋ก์ ํธ"๋ก ๋ฐ๊ฟ๋๋ค.
"exclude"
๋ "files"
์ํธ๋ฆฌ๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด, tsconfig.json
๋ฅผ ํฌํจํ๋ ํด๋ ์์ ๋ชจ๋ ํ์ผ๊ณผ ๋ชจ๋ ํ์-๋๋ ํฐ๋ฆฌ๊ฐ ์ปดํ์ผ์ ํฌํจ๋ฉ๋๋ค.
๋ง์ฝ ์ผ๋ถ ํ์ผ์ ์ ์ธํ๊ณ ์ถ์ผ๋ฉด "exclude"
๋ฅผ ์ฌ์ฉํ๊ณ , ์ปดํ์ผ๋ฌ๊ฐ ์ฐพ๋๋ก ํ๊ฒ ํ๋ ๋์ ๋ชจ๋ ํ์ผ์ ์ง์ ํ๊ณ ์ถ์ผ๋ฉด, "files"
๋ฅผ ์ฌ์ฉํ์ญ์์ค.
tsconfig.json
์ ์๋ ํฌํจ์
๋๋ค.
์์์ ๋
ผ์ํ ๋ด์ฅ ๋ชจ๋ ํด์์ด ์๋๋๋ค.
์ปดํ์ผ๋ฌ๋ ํ์ผ์ ๋ชจ๋ import ๋์์ผ๋ก ์๋ณํ ๊ฒฝ์ฐ, ์ด์ ๋จ๊ณ์์ ์ ์ธ๋์๋์ง์ ๊ด๊ณ์์ด ์ปดํ์ผ์ ํฌํจํ๊ฒ ๋ฉ๋๋ค.
๊ทธ๋์ ์ปดํ์ผ์ ํ์ผ์ ์ ์ธํ๊ธฐ ์ํด์๋, ๊ทธ ํ์ผ์ ์ ์ธํ๊ณ ๊ทธ ํ์ผ์ import
๋ /// <reference path="..."" />
์ง์๋ฌธ์ด ์๋ ๋ชจ๋ ํ์ผ์ ์ ์ธํด์ผ ํฉ๋๋ค.