【发布时间】:2014-08-30 07:44:03
【问题描述】:
我使用这个 guntfile.js 并为我的项目工作正常,但我不明白一些事情。
'use strict';
var bsoptions={
//porta di lavoro del livereload standard
port: 35729,
//path del nostro tema
themepath: "wp-content/themes/rttheme18",
//host inserito nell'installazione di wp
http_host: "www.bottonisworld.localhost"} ;
module.exports = function( grunt ) {
// inseriamo la configurazione di grunt
grunt.initConfig({
//carichiamo il file json
pkg: grunt.file.readJSON('package.json'),
//banner inseribile nei file nel caso di concat plugin ad esempio
banner: "Nome pacchetto <%= pkg.name %>",
//proprietà custom per mostrare il loro utilizzo nei task successivi con la sintassi di grunt engine
BSbasePath: bsoptions.themepath,
BSHTTP_HOST: bsoptions.http_host,
//____________ task "watch" _________
watch: {
// dichiariamo quali file deve guardare watch
scripts:{
files:[
'<%= BSbasePath %>/**/*.html',
'<%= BSbasePath %>/**/*.css','<%= BSbasePath %>/**/*.{png,jpg,jpeg,gif,webp,svg}']},
php: {
files: ['<%= BSbasePath %>/**/*.php']
},
//opzioni del task watch
options: {
//usiamo il livereload
livereload: true,
//inseriamo il keepalive
keepalive:true,
spawn: false
}
}
});
//loading dei plugin necessari al nostro lavoro
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-livereload');
//registrazione del task di lavoro che esegue ogni singolo task
grunt.registerTask('default', function() {
grunt.task.run([
'watch'
]);
});
};
我想要理解“scripts”和“php”任务。我在谷歌搜索但没有找到任何东西,有人可以解释我或告诉我在哪里可以找到这些任务/目标的文档?
【问题讨论】:
标签: php gruntjs task target watch