Open D1no opened 9 years ago
Adds a source map of retrieved values according to the processed source, to make use of a source arrays. Extends to {writeto}SrcMap. Fixes #32
{writeto}SrcMap
grunt.initConfig({ dom_munger: { your_target: { options: { read: { selector: 'script', attribute: 'src', // -> writeto: 'jsRefs', // <- isPath: true } }, // Going through multiple html files, collecting javascript references src: ['html/*.html'] }, }, log: {} });
grunt.config.process(<%= dom_munger.data.jsRefs %>)
[ 'html/assets/javascript5.js', 'html/assets/javascript6.js' ]
grunt.config.process(<%= dom_munger.data.jsRefsSrcMap %>)
{ 'html/first.html': [ 'html/assets/javascript1.js', 'html/assets/javascript2.js' ], 'html/second.html': [ 'html/assets/javascript3.js', 'html/assets/javascript4.js' ], 'html/third.html': [ 'html/assets/javascript5.js', 'html/assets/javascript6.js' ] }
Adds a source map of retrieved values according to the processed source, to make use of a source arrays. Extends to
{writeto}SrcMap
. Fixes #32Example
Array of last processed document (jsRefs):
grunt.config.process(<%= dom_munger.data.jsRefs %>)
Object source map with arrays of last processed document (jsRefsSrcMap):
grunt.config.process(<%= dom_munger.data.jsRefsSrcMap %>)