Ich erhalte die Fehlermeldung:Grunt: "Laden" Gruntfile.js "Aufgaben ... FEHLER >> SyntaxError: Unerwarteter Bezeichner Warnung: Aufgabe" default "nicht gefunden. Verwenden Sie --force, um fortzufahren."
„borted aufgrund Warnungen SC:. \ Atomworkspace \ angularproject \ conFusion> Grunzen oading "Gruntfile.js" Aufgaben ... ERROR
SyntaxError: Unexpected identifier arning: Task "default" not found. Use --force to continue. "
Ich wünsche Grunt könnte mich auf die Zeilennummer in der gruntfile verweisen, wo der Syntaxfehler auftritt. Ehrlich gesagt, sollte dies standardmäßig mit dem Paket kommen. Scheint ziemlich gesund für mich. Anyways hier ist mein Code. Ich kann nicht finden, wo das Problem ist jemand bitte helfen
'use strict';
module.exports = function(grunt) {
//time how long the tasks take.
require('time-grunt')(grunt);
//automatically load required grunt tasks
require('jit-grunt')(grunt, {useminPrepare: 'grunt-usemin'
});
// 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'
}]
}
},
clean: {
build: {
src: ['dist/']
}
},
useminPrepare: {
html: 'app/menu.html'
options: {
dest: 'dist'
}
},
//Concat
concat: {
options: {
separator: ';'
},
//dist configuration given by useminPrepare
dist: {}
},
//Uglify
Uglify: {
//dist configuration given by useminPrepare
dist: {}
},
cssmin: {
dist: {}
},
//Filerev
filerev: {
options: {
encoding: 'utf8',
algorithm: 'md5',
length: 20
},
release: {
//Filerev: release hashes(md5) all assets (images, js, and css)
// in dist direcftory
// brackets are used to specify file
files: [{
src: [
'dist/scripts/*.js',
'dist/styles/*.css',
]
}]
}
},
//useminPrepare``
//Replace all assets with their recent version in html and css files.
//options.assetDirs holds the directories for finding the assets
usemin: {
html: ['dist/*.html'],
css: ['dist/styles/*.css'],
options: {
assetDirs: ['dist', 'dist/styles']
}
}
});
grunt.registerTask('build', [
'clean',
'jshint',
'useminPrepare',
'concat',
'cssmin',
'uglify',
'copy',
'filerev',
'usemin'
]);
grunt.registerTask('default', ['build']);
};
Die Aufgabennamen sollten genau übereinstimmen. Sie haben Großbuchstabe U im Aufgabennamen "** ugglify **" verwendet. Bitte ändere es entsprechend. –
Danke Revive. Das hat funktioniert! Herzlichen Dank. –