[英]Grunt and Less. No «less» targets found?
I'm installed angular-generator
using Yeoman for my future project where I plan to use less
我安装angular-generator
使用约曼对我今后的项目中,我打算使用less
What I have: 我有的:
npm install grunt-contrib-less --save-dev
Gruntfile.js Gruntfile.js
watch: {
tests: '<%= nodeunit.tests %>',
tasks: 'default',
styles: {
files: ['app/styles/less/*.less'], // which files to watch
tasks: ['less']
}
},
less: {
development: {
options: {
paths: ["app/styles/less"],
yuicompress: true
},
files: {
// target.css file: source.less file
"app/styles/main.css": "app/styles/less/main.less"
}
}
},
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['jshint', 'clean', 'copy', 'useminPrepare', 'ngtemplates', 'concat', 'uglify', 'cssmin', 'usemin', 'nodeunit', 'less']);
After running grunt less, I have this error: 少运行咕unt声后,我出现此错误:
>> No "less" targets found.
Warning: Task "less" failed. Use --force to continue.
How I can fixing this? 我该如何解决?
Not sure of what you mentioned but I am using the following and it is working: 不知道您所说的是什么,但我正在使用以下内容,并且可以正常工作:
watch {
..,
less: {
files: ['<%= config.app %>/styles/{,*/}*.less'],
tasks: ['less']
},
},
....
less: {
production: {
options: {
paths: ['dist/styles'],
cleancss: false
},
files: {
'.tmp/styles/main.css': 'app/styles/main.less'
}
}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.