I want to minify all HTML pages and maintain the page's name and path on the dist
folder. I want to loop through all folders.
The code below works fine but ONLY for the parent folder (which is this case app/views
).
grunt.initConfig({
htmlmin: {
dev: {
files: [{
expand: true,
cwd: 'app/views/**',
src: '{,*/}*.html',
dest: 'dist/views'
}]
}
}
});
As you can notice, I tried the magic star at the path app/views/**
and had no luck.
This is my folder structure:
app/views/
├── page1.html
├── blocks
│ └── block.html
├── page2.html
└── page3.html
In my case, every template gets minified, except the ones under app/views/blocks
folder.
app/views/
– Luht