gpt4 book ai didi

javascript - 未找到 Grunt 任务默认值

转载 作者:行者123 更新时间:2023-12-03 11:13:33 26 4
gpt4 key购买 nike

当我运行命令 grunt 时,我收到错误:

Warning: Task "default" not found. Use --force to continue.

我的 Gruntfile.js :

module.export = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'dist/flatify.css':'sass/style.scss'
}
}
},
autoprefixer: {
dist: {
files: {
'dist/dist/flatify.css':'dist/flatify.css'
}
}
},
cssmin: {
css: {
scr: 'dist/flatify.css',
dest: 'dist/flatify.min.css'
}
},
watch: {
css:{
files: '**/*.scss',
tasks: ['sass','autoprefixer','cssmin:css']
}
}
});

grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['sass','autoprefixer', 'cssmin']);
}

我的package.json:

{
"name": "Flatify",
"version": "0.0.1",
"description": "An beautiful CSS framework",
"repository": {
"type": "git",
"url": "https://github.com/1ClickComputing/Flatify.git"
},
"keywords": [
"CSS"
],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/1ClickComputing/Flatify/issues"
},
"homepage": "https://github.com/1ClickComputing/Flatify",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-autoprefixer": "^2.0.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-sass": "^0.8.1",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1"
}
}

最佳答案

Gruntfile 中的第一行不正确。应该是:

module.exports = function (grunt)

它错过了 exports 处的 s

关于javascript - 未找到 Grunt 任务默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27447343/

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