gpt4 book ai didi

javascript - 未找到 Grunt 任务 (grunt-contrib-sass)

转载 作者:行者123 更新时间:2023-12-03 03:16:18 24 4
gpt4 key购买 nike

这是我的 gruntfile.js,它与 sass/style.scss 和 package.json 位于同一目录中。 package.json 安装了 gruntgrunt-contrib-sassgrunt-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"]);
};

知道为什么我收到任务未找到错误吗?

最佳答案

Saas 更改为 saas,如 example 中所示配置。

注意:任务名称的正确拼写以小写字母 (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`
};

关于javascript - 未找到 Grunt 任务 (grunt-contrib-sass),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46759015/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com