내 HTML 파일에 grunt-contrib-htmlmin
을 사용하고 있습니다. 내 Gruntfile.js
은 다음과 같습니다 있도록 Grunt-html minifier 작업이 실패합니다.
node_modules
디렉터리에 대한 예외를 추가 :
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
htmlmin: {
prod: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: {
src: ['**/*.html', '!node_modules/'],
dest: 'prod/'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-htmlmin');
내가 콘솔의 결과이기 때문에 무엇을 얻을 내가 grunt build
을 실행
는 "htmlmin 실행 : prod "(htmlmin) 작업
축소 된 1 파일 (1 실패)
오류없이 완료됩니다.
나는 4 개의 HTML 파일이 있으며 그 중 어느 것도 축소되지 않으며 오류가 표시되지 않습니다. 여기서 내가 무엇을 놓치고 있니?
당신이 실행되고있는 유일한 작업입니다 정말 확신 :
우리의 결과
은 다음과 같다? 이 작업은 "htmlmin : prod"라고하지만 오류 메시지는 "htmlmin : dist"를 참조합니다. – JJJ은 모두 같은 위치에있는 파일입니까? – Geraint
@Geraint 두 파일은 include라는 하위 디렉토리 안에 있지만, 중요하지 않은 소스에 대해 '**/* .html'을 사용하고 있기 때문에 그렇습니까? – brunodd