0

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

Beep
  • 2,737
  • 7
  • 36
  • 85
  • i am not sure that uncss can work with php file like you wrote src: '/application/views/includes/header.php' – Taras Budzyn Feb 23 '16 at 15:10
  • so you think just header.php ? – Beep Feb 23 '16 at 15:13
  • According to the grunt-uncss plugin documentation (https://github.com/addyosmani/grunt-uncss), your configuration for uncss task may be wrong. – Eria Feb 23 '16 at 15:13
  • thanks @Eria, il read through again, I know they use process html, but this is a codeigniter php project – Beep Feb 23 '16 at 15:14

1 Answers1

2

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

Taras Budzyn
  • 315
  • 4
  • 12