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.
cwd: 'app/views',
src: '**/*.html',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With