0
我使用这个guntfile.js并且对我的项目工作正常,但我不明白一些事情。grunt了解任务脚本和php
'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'
]);
});
};
我想已了解 “脚本” 和 “PHP” 的任务。我在谷歌搜索,但没有找到任何东西,有人可以解释我或告诉我在哪里可以找到这些任务/目标的文件?
正确的,但 我想知道在哪里可以找到任务“脚本”和“PHP”。如果我想使用的文档“ASP”文件我必须声明: ASP: {'<%= BSbasePath%>/**/*。asp'] } 如果是,那么文档在哪里? :( – lbottoni 2014-08-30 14:09:52
你有一个例子在这里http://scotch.io/bar-talk/a-simple-guide-to-getting-started-with-grunt 姓名'脚本'和'PHP'只是名字选择。我认为这并不重要,Grant如何命名它,Grant将会收集这些文件并且处理这些文件,Grant收集这些文件,只需要命名Javascript脚本需要的文件和PHP执行的文件被称为'php'。 – 2014-08-30 15:28:54