I want to collect all the javascript file references (paths) from all html files [src].
Is there a way to achieve this? Currently, the writeto variable jsRefs is getting overwritten and I am not sure how to get around this.
grunt.initConfig({
dom_munger: {
your_target: {
options: {
read: {
selector: 'script',
attribute: 'src',
// Is there a way to instruct jsRefs to be
// a multi-dimensional array or object.key
// combination per source file holding
// the jsRefs Arrays?
writeto: 'jsRefs',
// <-
isPath: true
}
},
// Going through multiple html files, collecting javascript references
src: ['html/*.html']
},
},
log: {}
});
grunt.registerTask("log", function() {
var jsFiles = grunt.config.process('<%= dom_munger.data.jsRefs %>');
// only last processed file with array of paths
console.dir(jsFiles);
});
I want to collect all the javascript file references (paths) from all html files [src].
Is there a way to achieve this? Currently, the writeto variable jsRefs is getting overwritten and I am not sure how to get around this.