그런트
그런트(Grunt)는 축소화, 컴파일, 유닛 테스트, 린트 등 주기적인 태스크들을 자동으로 수행하기 위해 사용되는 도구로서 자바스크립트 태스크 러너이다. Gruntfile이라는 파일에 정의된 사용자 지정 태스크들을 수행하기 위해 명령 줄 인터페이스를 사용한다. 그런트는 Ben Alman이 개발하였으며 Node.js로 작성되어 있다. npm을 통해 배포된다. 2016년 9월 기준으로, 그런트 생태계에 5,000개 이상의 플러그인을 사용할 수 있다.[3]
원저자 | Ben Alman |
---|---|
개발자 | Ben Alman, Tyler Kellen, Kyle Robinson Young, Vlad Filippov, Sindre Sorhus, Isaac Durazo, Jarrod Overson, Tim Branyen, Jörn Zaefferer, James Smith, Dave Geddes |
발표일 | 2012년 1월 11일 |
안정화 버전 | 1.0.3
/ 2018년 6월 3일[1] |
저장소 | |
프로그래밍 언어 | Node.js |
운영 체제 | 리눅스, 윈도우, macOS |
언어 | 영어 |
종류 | 태스크 러너, 빌드 자동화 |
라이선스 | MIT 허가서[2] |
상태 | 개발 중 |
웹사이트 | gruntjs |
그런트를 사용하는 기업으로는 어도비 시스템즈, jQuery, 트위터, 모질라, 부트스트랩, Cloudant, 오페라, 워드프레스, 월마트, 마이크로소프트가 있다.[3]
예제
편집다음은 플러그인 로드 방법, 사용자 지정 태스크 만들기 등을 설명하기 위해 자바스크립트로 작성된 Gruntfile의 예제이다.
module.exports = function(grunt) {
// Task configuration
grunt.initConfig({
taskName1: 'Task1 Configuration',
taskName2: 'Task2 Configuration'
});
// Loads plugins
grunt.loadNpmTasks('pluginName1');
grunt.loadNpmTasks('pluginName2');
// Custom tasks
grunt.registerTask('customTaskName1', 'Custom task description', function(taskParameter) {
// Custom statements
});
// Combining multiple tasks to a single task
grunt.registerTask('customTaskName2', ['taskName1', 'customTaskName1']);
// Default task - runs if task name is not specified
grunt.registerTask('default', ['customTaskName2']);
};
같이 보기
편집각주
편집- ↑ “grunt/CHANGELOG at master · gruntjs/grunt”. 2018년 1월 11일에 확인함.
- ↑ “Grunt License - NPM”. 2019년 5월 27일에 원본 문서에서 보존된 문서. 2019년 5월 27일에 확인함.
- ↑ 가 나 “Grunt: The JavaScript Task Runner”. 《gruntjs.com》. 2016년 9월 10일에 원본 문서에서 보존된 문서. 2016년 9월 14일에 확인함.
참고 문헌
편집- Cryer, James (2015). 《Pro Grunt.js》. Apress. ISBN 978-1-4842-0013-1.
- Pillora, Jamie (2014). 《Getting Started with Grunt: The JavaScript Task Runner》. Packt Publishing Ltd. ISBN 978-1-78398-062-8.