0
我有我的gruntfile這個任務:分裂了gruntfile
jade: {
compile: {
options: {
client: false,
pretty: true,
data: {
section: grunt.file.readJSON('json/section.json')
}
},
files: [ {
cwd: "app/views",
src: "**/*.jade",
dest: "build/templates",
expand: true,
ext: ".html"
} ]
}
}
然而,當我這個片段添加到一個js文件jade.js像這樣:
module.exports = {
compile: {
options: {
client: false,
pretty: true,
data: {
section: grunt.file.readJSON('json/section.json')
}
},
files: [ {
cwd: "app/views",
src: "**/*.jade",
dest: "build/templates",
expand: true,
ext: ".html"
} ]
}
}
我得到的錯誤的ReferenceError:咕嚕沒有定義
雖然我具有以下設置:
aliases.yaml
default:
- 'jade'
- 'sass'
- 'watch
文件夾結構
/grunt
aliases.yaml
jade.js
sass.js
watch.js
Gruntfile.js
module.exports = function(grunt) {
// load grunt config
require('load-grunt-config')(grunt);
};
我已經安裝了load-grunt-config和load-grunt-tasks。
你的先生是一個真正的英雄!我向你們致敬。 – user1937021