step 2 업데이트
@70c56619ba5bfe878acc01fae5ca4caeb1d6cc29
+++ step2_default_task/README.md
... | ... | @@ -0,0 +1,27 @@ |
| 1 | +## STEP 2. Default Task | |
| 2 | + | |
| 3 | +앞서 step 1에서 `gulp hello` 로 hello task 를 실행했는데, 항상 hello task를 실행한다면 hello task를 기본값으로 설정해줄 수 있습니다. | |
| 4 | + | |
| 5 | +```javascript | |
| 6 | +var gulp = require('gulp'); | |
| 7 | + | |
| 8 | +// hello world 라고 콘솔에 찍는 task | |
| 9 | +gulp.task('hello', function () { | |
| 10 | + return console.log('Hello World!'); | |
| 11 | +}); | |
| 12 | + | |
| 13 | +//gulp를 실행하면 default 로 hello task 실행 | |
| 14 | +gulp.task('default', ['hello']); | |
| 15 | +``` | |
| 16 | + | |
| 17 | +step 1과는 다르게 'default' 라는 task가 추가되었고, 이 default task의 두번째 파라메터에 배열 형태로 'hello'가 추가되어 있는 것을 볼 수 있습니다. | |
| 18 | +이제 `gulp hello` 라고 입력할 필요없이, 아래와 같이 `gulp` 라고만 하면 hello task 를 실행할 수 있습니다. | |
| 19 | + | |
| 20 | + | |
| 21 | +```bash | |
| 22 | +$ gulp | |
| 23 | +``` | |
| 24 | + | |
| 25 | +hello 라는 task 를 실행하면 아래와 같이 'Hello world!' 라는 메시지만 출력하고 종료되는 것을 볼 수 있습니다. | |
| 26 | + | |
| 27 | + |
--- step2_default task/gulpfile.js
+++ step2_default_task/gulpfile.js
| No changes |
+++ step2_default_task/step2.png
| Binary file is not shown |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?