Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dom_munger issue with Node 7.7.3 - Path must be a string

I'm trying to update an application to support Node -v 7.7.3. But when I am running the grunt task dom_munger as per below:

dom_munger:{
  read: {
    options: {
      read:[
        {selector:'script[data-concat!="false"]',attribute:'src',writeto:'appjs', isPath: true},
        {selector:'link[rel="stylesheet"][data-concat!="false"]',attribute:'href',writeto:'appcss'}
      ]
    },
    src: 'app/index.html'
  }
}

I receive error:

Warning: Path must be a string. Received [ 'app/index.html' ] Use --force to continue.

I wonder if there is a way to rewrite above grunt task or if there might be a good alternative to dom_munger. Any help would be appreciated.

like image 866
sandrasvensson Avatar asked Mar 03 '26 18:03

sandrasvensson


1 Answers

Per the grunt-dom-munger Github:

When isPath is true, the extracted values are assumed to be file references and their path is made relative to the Gruntfile.js rather than the file they're read from.

Try removing the isPath property, or altering it to match the path from your Gruntfile to the index.html file.

like image 88
Mitch Lillie Avatar answered Mar 06 '26 08:03

Mitch Lillie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!