cgross / grunt-dom-munger

Grunt task to read and manipulate HTML with CSS selectors.
MIT License
93 stars 40 forks source link

Node v6.9.2 error but works on earlier versions #42

Closed ghost closed 3 years ago

ghost commented 7 years ago

Updated to node v6.9.2 and now get the following error in a yo generator that includes a Gruntfile.js

Running "dom_munger:read" (dom_munger) task

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

I've made no changes to the Gruntfile.js and this is the config of dom_munger read object:

            read: {
                options: {
                    read: [
                        {selector: '[build-concat]', attribute: 'src', writeto: 'jsRefs', isPath:true}
                    ]
                },
                src: 'index.html'
            }, 

Any suggestions?

ghost commented 7 years ago

For info: Removing isPath:true fixed this issue

jrgleason commented 7 years ago

So is this the legitimate answer? Should we change path.dirname(grunt.file.expand(f)) to handle an array as well as a string?

hagabaka commented 7 years ago

Pull requests #44 and #45 are both meant to fix this. As for whether removing isPath: true is a good workaround, the README says this option "is usually necessary when passing the values to another grunt task like concat or uglify", but I haven't verified it.

niemyjski commented 3 years ago

We've fixed this in 4.0 :)