grunt-dom-munger
grunt-dom-munger copied to clipboard
options.read() get only needed ones
Can I configure the options.read()
method to only get me the script
tags I want to?
If I got it right, I can only get all script
tags' src
attribute.
Yes, you can. You appear to be able to use selectors (Think its XPATH).
e.g. Don't read those items which have data-concat attribute set to false
dom_munger:{
read: {
options: {
read:[
{selector:'script[data-concat!="false"]',attribute:'src',writeto:'appjs'},
{selector:'link[rel="stylesheet"][data-concat!="false"]',attribute:'href',writeto:'appcss'}
]
},
src: 'app/index.html'
},