Gruntjs grunt htmlmin未发送到dist文件夹
我已经设置了grunt来缩小我的html,但是当我运行'grunt htmlmin' 它不会将其发送到我的dist文件夹,以下是我使用的设置:Gruntjs grunt htmlmin未发送到dist文件夹,gruntjs,Gruntjs,我已经设置了grunt来缩小我的html,但是当我运行'grunt htmlmin' 它不会将其发送到我的dist文件夹,以下是我使用的设置: htmlmin: { dist: { options: { removeComments: true, collapseWhitespace: true }, files: [{ expand: true,
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: [{
expand: true,
cwd: 'src',
src: '**/*.html',
dest: 'dist/'
}],
},
},
我有什么设置错误吗 您的配置似乎很好-下面就是在我的机器上运行的
Gruntfile.js
。你能试试你这边吗
module.exports = function(grunt) {
grunt.initConfig({
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: [{
expand: true,
cwd: 'src',
src: '**/*.html',
dest: 'dist/'
}],
},
},
});
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.registerTask('default', ['htmlmin']);
};
这是说,当我有一个index.html时,缩小了0个文件。我需要有多个html文件才能工作吗?缩小只需要1个文件就可以了,必须是其他文件。index.html位于哪个文件夹中?