GRUNT UNCSS error

341 views Asked by At

I keep getting error when I run grunt, dose anyone know how to use UNCSS with php ?

Fatal error: spawn C:\Users\**.**\Desktop\PhpstormProjects\**\node_modules\phantomjs\lib\phantom\phantomjs.exe ENOENT

Im not sure how to fix this problem, my UNCSS file looks like

 uncss: {
    dist: {
        options: {

            stylesheets  : ['css/clean.min.css'],
            style: 'compressed'
        },

        files: [
            //{ src: '*.html', dest: 'css/uncss/compiled.min.css'}
            {
                'css/app.clean.css': ['**/*.php']
            }
        ]
    }
},

All help is much appreciated

1

There are 1 answers

0
Taras Budzyn On

After a few research in google, i will finish with conclusion that you can't use a dynamically php files for uncss (as i said in comment above).

You should generate the html result of page for uncss or use links for pages instead.

Please read this article (it's about Wordpress, but you should get the basic idea)

Liam Gladdy blog article about uncss