Gruntjs grunt:如何检测文件是否保存到我所有的js文件
我试图检测是否有一些js被保存到我的js文件或css文件中 我在GruntFile.js中有以下代码:Gruntjs grunt:如何检测文件是否保存到我所有的js文件,gruntjs,task-runner-explorer,Gruntjs,Task Runner Explorer,我试图检测是否有一些js被保存到我的js文件或css文件中 我在GruntFile.js中有以下代码: /// <binding ProjectOpened='uglify' /> module.exports = function (grunt) { grunt.initConfig({ uglify: { bundle: { files: { 'Scripts/boooo.min.js': 'Scr
/// <binding ProjectOpened='uglify' />
module.exports = function (grunt) {
grunt.initConfig({
uglify: {
bundle: {
files: { 'Scripts/boooo.min.js': 'Scripts/bootstrap.js' }
}
},
watch: {
js: {
files: ['Scripts/**/*.js'],
tasks: ['uglify']
}
}
});
// Next one would load plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
// Here is where we would define our task
grunt.registerTask('default', ['watch:js']);
};
如何检测它是否已保存
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['scripts/**/*.js'],
tasks: ['uglify']
}
},
uglify: {
my_target: {
options: {
beautify: false
},
files: {
'/Scripts/app.min.js': ['scripts/**/*.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify:my_target', 'watch']);
};
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['scripts/**/*.js'],
tasks: ['uglify']
}
},
uglify: {
my_target: {
options: {
beautify: false
},
files: {
'/Scripts/app.min.js': ['scripts/**/*.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify:my_target', 'watch']);
};