Grunt の監視タスクを使用すると、Grunt.js は明らかに新しい node.js プロセスを生成します。
http://www.youtube.com/watch?v=fgRlcFt9dkg
ドキュメントを保存するとすぐに、デフォルトのタスクが実行され、(ビデオでわかるように) 新しい node.exe プロセスが突然発生します。
これは私のうなり声です:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-yui-compressor');
// Project configuration.
grunt.initConfig({
// Metadata.
meta: {
version: '1.0',
},
banner: '/*! Copyright (c) <%= grunt.template.today("yyyy") %> */\n',
// Task configuration.
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
develop: {
src: ['js/app.main.js', 'js/app/*.js', 'js/app.debug.js', 'js/app.workarounds.js', 'js/app.init.js'],
dest: 'build/js/app.js'
},
production: {
src: ['js/app.main.js', 'js/app/*.js', 'js/app.workarounds.js', 'js/app.init.js'],
dest: 'build/js/app.js'
},
habla_css: {
src: ['build/habla.css'],
dest: 'build/habla.css'
},
wiwo_css: {
src: ['build/wiwo.css'],
dest: 'build/wiwo.css'
},
iefix: {
src: 'js/iefix/*',
dest: 'build/js/iefix.js'
},
libs: {
src: ['js/src/*'],
dest: 'build/js/libs.js'
}
},
clean: {
pre: [
'build'
],
post: 'dest'
},
copy: {
thirdparty: {
files: [
{
expand: true,
src: ['js/jquery.min.js'],
dest: 'build/',
}]
}
},
min: {
options: {
report: false,
banner: '<%= banner %>'
},
app: {
src: ['build/js/app.js'],
dest: 'build/js/app.min.js'
},
iefix: {
src: 'js/iefix.js',
dest: 'build/js/iefix.min.js'
},
libs: {
src: ['js/src/*'],
dest: 'build/js/libs.min.js'
},
},
cssmin: {
options: {
report: false,
banner: '<%= banner %>'
},
icons: {
src: ['build/icons.css'],
dest: 'build/icons.min.css'
},
habla: {
src: ['build/habla.css'],
dest: 'build/habla.min.css'
},
wiwo: {
src: ['build/wiwo.css'],
dest: 'build/wiwo.min.css'
}
},
less: {
icons: {
src: ['less/system/icons.less'],
dest: 'build/icons.css'
},
habla: {
src: ['less/habla.less'],
dest: 'build/habla.css'
},
wiwo: {
src: ['less/wiwo.less'],
dest: 'build/wiwo.css'
}
},
replace: {
production: {
src: 'build/js/app.js',
dest: 'build/js/app.js',
replacements: [{
from: /\s*App.debug.(log|group|groupEnd)\(.*\);/g,
to: ''
},
{
from: 'debug: true',
to: 'debug: false'
}]
},
date: {
src: 'build/js/app.js',
dest: 'build/js/app.js',
replacements: [{
from: '/*!%CURDATE%*/',
to: 'console.log("' + d.replace(/(T|Z)/gi,' ') + '");'
}]
}
},
qunit: {
files: ['tests/**/*.html']
},
watch: {
main: {
files: ['grunt.js', 'js/app.*.js', 'js/**/*', 'less/**/*', 'less/*'],
tasks: ['default'],
options: {
nospawn: true
}
}
}
});
grunt.registerTask('con', ['concat:habla_css', 'concat:wiwo_css', 'concat:iefix', 'concat:libs']);
grunt.registerTask('icons', ['less:icons cssmin:icons']);
grunt.registerTask('test', ['qunit']);
// Default task.
grunt.registerTask('default', ['less:habla', 'less:wiwo', 'concat:develop', 'con', 'replace:date', 'copy:thirdparty', 'clean:post', 'watch']);
grunt.registerTask('release', ['clean:pre', 'less', 'concat:production', 'con', 'replace:production', 'copy:thirdparty', 'min', 'cssmin', 'clean:post']);
};
それで、それはうなり声のバグですか、それとも私のうなり声のバグですか? 私が使用している grunt のバージョンは、Windows 7 x64 で 0.4.1 (+ grunt-cli 0.1.9) です。