我在未来的项目中使用Yeoman安装了angular-generator,并计划使用less
我拥有的:
npm install grunt-contrib-less --save-devGruntfile.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']);在运行较少的咕噜声之后,我有以下错误:
>> No "less" targets found.
Warning: Task "less" failed. Use --force to continue.我怎么能修好这个?
发布于 2015-07-28 13:12:20
我不知道你提到了什么,但我使用的是下面的内容,它正在起作用:
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'
}
}
},https://stackoverflow.com/questions/31677111
复制相似问题