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: { ...
一個網頁設計師經驗分享部落格,內容涵蓋HTML, CSS, RWD, Nodejs, React 的技術。