0
votes

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
i am not sure that uncss can work with php file like you wrote src: '/application/views/includes/header.php' - Taras Budzyn
so you think just header.php ? - Beep
According to the grunt-uncss plugin documentation (github.com/addyosmani/grunt-uncss), your configuration for uncss task may be wrong. - Eria
thanks @Eria, il read through again, I know they use process html, but this is a codeigniter php project - Beep

1 Answers

2
votes

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