grunt-assets-versioning
grunt-assets-versioning copied to clipboard
Unable to process multiple files
Trying to version multiple files unfortunately I keep having a warning: Task 'assets_versioning:files' doesn't have any src-dest file mappings.
assets_versioning: {
options: {
tag: 'hash',
hashLength: 6,
versionsMapFile: './apps/frontend/assets/version.json'
},
files: {
'./public_html/css/file1.css' : './public_html/css/file1.css',
'./public_html/css/file2.min.css' : './public_html/css/file2.min.css'
}
}
Also tried this approach. But this is giving: Object #<Object> has no method 'indexOf'
assets_versioning: {
options: {
tag: 'hash',
hashLength: 6,
versionsMapFile: './apps/frontend/assets/version.json'
},
files: [
{
src: './public_html/css/file1.min.css',
dest: './public_html/css/file1.min.css',
},
{
src: './public_html/css/file2.min.css',
dest: './public_html/css/file2.min.css',
}
]
}
Sorry. Missed the target. This is working.
assets_versioning: {
options: {
tag: 'hash',
hashLength: 6,
versionsMapFile: './apps/frontend/assets/version.json'
},
target: {
files: [
{
src: './public_html/css/file1.min.css',
dest: './public_html/css/file1.min.css',
},
{
src: './public_html/css/file2.min.css',
dest: './public_html/css/file2.min.css',
}
]
}
}
You definitely need to specify a target and you also need to declare files as explained in the grunt documentation: http://gruntjs.com/configuring-tasks#files Can I close this ticket?
@theasta you mean that the examples in the doc are wrong?