. 그러나 해결 방법을 사용할 수 있습니다. 자신의 Gruntfile에 다음 코드를 복사 :
// Clobber the original targets
var targets = {
// Add as many custom targets as you want, using custom modules, etc.
// Keep the existing targets
default : ' rjs concat css min img rev usemin manifest',
usemin : 'usemin-handler rjs concat css img rev usemin manifest',
text : 'usemin-handler rjs concat css min rev usemin manifest',
buildkit : 'usemin-handler rjs concat css min img rev usemin manifest html:buildkit',
basics : 'usemin-handler rjs concat css min img rev usemin manifest html:basics',
minify : 'usemin-handler rjs concat css min img rev usemin manifest html:compress',
test : 'usemin-handler rjs concat css img rev usemin manifest',
yourbuild : 'intro clean mkdirs rjs'
};
// If we clobber targets, we have to rebuild targetList, the below is copy paster from Yeoman.js
var targetList = grunt.log.wordlist(Object.keys(targets));
// We also have to rebuild the build task with the new targetList
grunt.registerTask('build', 'Run a predefined target - build:<target> \n' + targetList, function(target) {
var valid = Object.keys(targets);
target = target || 'usemin';
if (valid.indexOf(target) === -1) {
grunt.log
.error('Not a valid target')
.error(grunt.helper('invalid targets', targets));
return false;
}
var tasks = ['intro', 'clean coffee compass mkdirs', targets[target], 'copy time'].join(' ');
// Now overwrite the task for our costume build
if(target === 'yourbuild') {
tasks = targets[target];
}
// Conditionally remove compass/manifest task if either compass or
// phantomjs binary is missing. Done only for `test` target (specifically
// used for our `npm test`). For each, output warning infos.
if(target === 'test') {
tasks = grunt.helper('build:skip', tasks, 'compass');
tasks = grunt.helper('build:skip', tasks, 'phantomjs', 'manifest');
}
grunt.log.subhead('Running ' + target + ' target')
.writeln(' - ' + grunt.log.wordlist(tasks.split(' '), { separator: ' ' }));
grunt.task.run(tasks);
});
지금 당신이 당신의 자신의 빌드 프로세스 사용자 정의 다음 줄을 변경할 수 있습니다
yourbuild : 'intro clean mkdirs rjs'
하지만 기억하시기 바랍니다,이 코드는 유사시에서 복사 입니다 출처이고 업데이트 된 경우 직접 혼자해야합니다.
옙이게 더 의미가 있습니다, 감사합니다 Sindre – climboid