0
我安裝NPM, 跑NPM初始化, 安裝grunt grunt-contrib-less grunt-contrib-watch jit-grunt --save-dev
爲什麼我的小文件不能編譯成grunt?
和我gruntfile.js樣子:
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"css/main.css": "less/main.less" // destination file : source file
}
}
},
watch: {
styles: {
files: ['_components/**/*.less'], // which files to watch
tasks: ['less']
}
}
});
grunt.registerTask('default', ['less', 'watch']);
};
,當我這個目錄的一切似乎是想確定在運行繁重的,除了沒有什麼是發生。
如果我做出改變咕嚕正確地吐出:
Running "watch" task
Waiting...
>> File "_components\less\_mixins.less" changed.
Running "less:development" (less) task
>> 1 stylesheet created.
Done.
Completed in 0.606s at Wed Jul 05 2017 12:45:41 GMT-0500 (Central Daylight Time) - Waiting...
然而
當我去檢查我的main.less文件,它是空的,當我去檢查我的main.css文件,它也是空。我的代碼是不是正在編譯,或者它正在我不知道的地方?