跳到主要內容

發表文章

目前顯示的是 2月, 2014的文章

Grunt: Watch multiple files, Compile only Changed

It's easy to complier JS that is changed after setting gunt-contrib-watch. But how to watch multiple files but compile only Changed ? This is a sample [Grunt watch] & [ Google closure] for you : *Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ closure-compiler: { other: { closurePath:'/Library/closure/', js: ['js/*.js' ], jsOutputFile: 'js/dist/*.js', noreport: true, options: { compilation_level: 'SIMPLE_OPTIMIZATIONS', //compilation_level: 'ADVANCED_OPTIMIZATIONS', warning_level:"DEFAULT", define: [ '"DEBUG=false"', '"UI_DELAY=500"' ], } } }, watch: { ...