Skip to content

Commit 2e6ec49

Browse files
authored
Intergrating with Build Tools 전체 검토 및 번역 (ref #54) (#68)
* Intergrating with Build Tools 전체 검토 및 번역 (ref #54) * 마지막줄 수정 * lint fix
1 parent 4663a72 commit 2e6ec49

File tree

1 file changed

+70
-8
lines changed

1 file changed

+70
-8
lines changed

pages/Integrating with Build Tools.md

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
빌드 도구들
22

3+
* [Babel](#babel)
34
* [Browserify](#browserify)
45
* [Duo](#duo)
56
* [Grunt](#grunt)
@@ -9,6 +10,46 @@
910
* [MSBuild](#msbuild)
1011
* [NuGet](#nuget)
1112

13+
# Babel
14+
15+
### 설치
16+
17+
```sh
18+
npm install @babel/cli @babel/core @babel/preset-typescript --save-dev
19+
```
20+
21+
### .babelrc
22+
23+
```js
24+
{
25+
"presets": ["@babel/preset-typescript"]
26+
}
27+
```
28+
29+
### 커맨드 라인 인터페이스 사용
30+
31+
```sh
32+
./node_modules/.bin/babel --out-file bundle.js src/index.ts
33+
```
34+
35+
36+
### package.json
37+
38+
```js
39+
{
40+
"scripts": {
41+
"build": "babel --out-file bundle.js main.ts"
42+
},
43+
}
44+
```
45+
46+
### 커맨드 라인 인터페이스 사용
47+
48+
```sh
49+
npm run build
50+
```
51+
52+
1253
# Browserify
1354

1455
### 설치
@@ -67,7 +108,7 @@ Duo(__dirname)
67108
.use(typescript())
68109
.run(function (err, results) {
69110
if (err) throw err;
70-
// 컴파일된 결과를 출력 파일에 작성합니다.
111+
// 컴파일된 결과를 출력 파일에 작성합니다
71112
fs.writeFileSync(out, results.code);
72113
});
73114
```
@@ -108,7 +149,7 @@ module.exports = function(grunt) {
108149
npm install gulp-typescript
109150
```
110151

111-
### Basic gulpfile.js
152+
### 기본 gulpfile.js
112153

113154
```js
114155
var gulp = require("gulp");
@@ -146,7 +187,28 @@ _주의사항: 현재 jspm의 TypeScript 지원은 0.16beta 입니다._
146187
npm install ts-loader --save-dev
147188
```
148189

149-
### 기본 webpack.config.js
190+
### Webpack 2 사용 시 기본 webpack.config.js
191+
192+
```js
193+
module.exports = {
194+
entry: "./src/index.tsx",
195+
output: {
196+
path: '/',
197+
filename: "bundle.js"
198+
},
199+
resolve: {
200+
extensions: [".tsx", ".ts", ".js", ".json"]
201+
},
202+
module: {
203+
rules: [
204+
// '.ts' 또는 '.tsx' 확장자를 가진 모든 파일은 'ts-loader'에 의해 처리됩니다.
205+
{ test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ }
206+
]
207+
}
208+
}
209+
```
210+
211+
### Webpack 1 사용 시 기본 webpack.config.js
150212

151213
```js
152214
module.exports = {
@@ -175,12 +237,12 @@ module.exports = {
175237

176238
# MSBuild
177239

178-
프로젝트 파일을 업데이트하여 로컬에 설치된 `Microsoft.TypeScript.Default.props` (맨 위)와 `Microsoft.TypeScript.targets` (맨 아래) 파일을 포함하도록 하세요:
240+
로컬에 설치된 `Microsoft.TypeScript.Default.props` (맨 위)와 `Microsoft.TypeScript.targets` (맨 아래) 파일을 포함하도록 프로젝트 파일을 업데이트하세요:
179241

180242
```xml
181243
<?xml version="1.0" encoding="utf-8"?>
182244
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
183-
<!-- 하단에 기본 props 포함 -->
245+
<!-- 하단에 default props 포함 -->
184246
<Import
185247
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props"
186248
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
@@ -195,14 +257,14 @@ module.exports = {
195257
<TypeScriptSourceMap>false</TypeScriptSourceMap>
196258
</PropertyGroup>
197259

198-
<!-- 하단에 기본 대상 포함 -->
260+
<!-- 하단에 default targets 포함 -->
199261
<Import
200262
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"
201263
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
202264
</Project>
203265
```
204266

205-
MSBuild 컴파일러 옵션 정의에 대한 자세한 내용: [MSBuild 프로젝트의 컴파일러 옵션 설정](./Compiler Options in MSBuild.md)
267+
MSBuild 컴파일러 옵션 정의에 대한 자세한 내용: [MSBuild 프로젝트의 컴파일러 옵션 설정](./Compiler%20Options%20in%20MSBuild.md)
206268

207269
# NuGet
208270

@@ -211,4 +273,4 @@ MSBuild 컴파일러 옵션 정의에 대한 자세한 내용: [MSBuild 프로
211273
* `Install` 클릭
212274
* 설치가 완료되면 다시 빌드 하세요!
213275

214-
자세한 내용은 [패키지 매니저 다이얼로그](http://docs.nuget.org/Consume/Package-Manager-Dialog)[NuGet과 nightly builds 사용](https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#using-nuget-with-msbuild)
276+
자세한 내용은 [패키지 매니저 다이얼로그](http://docs.nuget.org/Consume/Package-Manager-Dialog)[NuGet과 nightly builds 사용](https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#using-nuget-with-msbuild)을 참고하세요

0 commit comments

Comments
 (0)