我刚开始使用Grunt,我可能已经有问题了。所以,下面是我的Gruntfile.js的样子:
module.exports = function (grunt) {
grunt.initConfig({
// Ability to access the package.json informations
pkg: grunt.file.readJSON('package.json'),
// SASS compilation
sass: {
dist: {
options: {
style: 'compressed'
},
expand: true,
cwd: './sass/',
src: 'main.scss',
dest: './css/',
ext: '.css'
},
dev: {
options: {
style: 'expanded',
debugInfo: true,
lineNumbers: true
},
expand: true,
cwd: './sass/',
src: 'main.scss',
dest: './css/',
ext: '.css'
}
}
});
};当我运行grunt sass:dev时,它总是返回给我Warning: Task "sass:dev" not found. Use --force to continue.
当我开始的时候,我看了看医生,找不到我可能出了什么问题.是的,依赖项是正确安装的。
发布于 2013-10-25 22:00:35
您需要确保任务在initConfig部分之后被注册。
module.exports = function (grunt) {
grunt.initConfig({
// ...
});
grunt.loadNpmTasks('grunt-contrib-sass');
};https://stackoverflow.com/questions/19599617
复制相似问题