这是我的gruntfile.js,它与sass/style.scss和package.json位于同一个目录中。package.json安装了grunt、grunt-contrib-sass和grunt-cli。
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// this is where you set up your Sass settings. Once you know what you're doing, you can change thse.
Sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'style.css': 'sass/style.scss'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('default', ["Sass"]);
};知道为什么我收到的任务没有发现错误吗?
发布于 2017-10-16 11:25:33
将Saas更改为saas,如示例配置所示。
注意:任务名称的正确拼写以小写(s).开头
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: { // <-- Change to lowercase `s`
dist: {
options: {
style: 'compressed'
},
files: {
'style.css': 'sass/style.scss'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('default', ["sass"]); // <-- Change to lowercase `s`
};https://stackoverflow.com/questions/46759015
复制相似问题