I'm using grunt and usemin with my angularjs project. Specifically my issue is concerned with usemin
not revving image tags in any *.html file within a subdirectory of views.
My .html files are in the following structure
dist/
index.html
views/
profile.html
partials/
header.html
...
The grunt usemin:html
task is processing everything in views/ but not within any of it's subfolders. ie. partials/*
Here is my grunt config:
...
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>'
}
},
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
...
I tried adding these options to my usemin
config:
options: {
basedir: '<%= yeoman.dist %>',
dirs: ['<%= yeoman.dist %>/**/*']
}
But still it doesn't process any subfolder of views.
Thanks to jakerella's answer noa's comment I got the following to work:
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html', '<%= yeoman.dist %>/views/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
I think you're close, but I think you'll want to use the **
glob pattern in the html
target of the usemin
task:
usemin: {
html: ['<%= yeoman.dist %>/**/*.html'],
...
}
And you might need an expand: true
in there as well (but not sure if the usemin
task uses that option).
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