I used Yeoman to create a web app in EmberJS. Everything works ok, but after using the grunt build
command, if I view the built app in the browser (from dist di
Try this:
usemin: {
html: ['<%= yeoman.dist %>/**/*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
js: ['<%= yeoman.dist %>/scripts/**/*.js'],
options: {
dirs: ['<%= yeoman.dist %>', '<%= yeoman.dist %>/styles', '<%= yeoman.dist %>/scripts'],
assetsDirs: ['<%= yeoman.dist %>', '<%= yeoman.dist %>/styles', '<%= yeoman.dist %>/scripts'],
patterns: {
js: [
[/["']([^:"']+\.(?:png|gif|jpe?g))["']/img, 'Image replacement in js files']
]
}
}
}
From here: Grunt plugin for assets versioning
The regex glob validates, as opposed to other solution shown here.
Also rolled back to use-min 2.1.1 npm install grunt-usemin@2.1.1 --save-dev
Although, I think 'assetsDirs' as opposed to just 'dirs' causes the undefined function error?