これはGruntfile.jsを設定しようとする最初の試みであり、この "警告:タスク"のデフォルトが見つからない原因を突き止めることができません。警告のために。エラー。誰かが私のコードに何が間違っているのか理解してもらえますか?以下のソースコードをお探しください:Gruntfile.js構文エラー:警告:タスク「デフォルト」が見つかりません。 --forceを使用して続行する
'use strict';
module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required Grunt tasks
require('jit-grunt')(grunt);
// Define the configuration for all the tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Make sure code styles are up to par and there are no obvious mistakes
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: {
src: [
'Gruntfile.js',
'app/scripts/{,*/}*.js'
]
}
}
}),
copy: {
dist: {
cwd: 'app',
src: [ '**','!styles/**/*.css','!scripts/**/*.js' ],
dest: 'dist',
expand: true
},
fonts: {
files: [
{
//for bootstrap fonts
expand: true,
dot: true,
cwd: 'bower_components/bootstrap/dist',
src: ['fonts/*.*'],
dest: 'dist'
}, {
//for font-awesome
expand: true,
dot: true,
cwd: 'bower_components/font-awesome',
src: ['fonts/*.*'],
dest: 'dist'
}
]
}
},
clean: {
build: {
src: [ 'dist/']
}
});
grunt.registerTask('build', [
'clean',
'jshint',
'copy'
]);
grunt.registerTask('build', [
'jshint'
]);
grunt.registerTask('default',['build']);
};
助けてくれてありがとうJasonですが、私はコードの一番下にあなたのものと似た「デフォルト」というタスクの定義がありますが、デフォルトのタスクはまったく存在しないかのように警告を受けます。それ以上の提案はありますか? –