【问题标题】:GRUNT UNCSS errorGRUNT UNCSS 错误
【发布时间】:2016-02-23 14:52:26
【问题描述】:

我在运行 grunt 时总是出错,请问有人知道如何在 php 中使用 UNCSS 吗?

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

我不知道如何解决这个问题,我的 UNCSS 文件看起来像

 uncss: {
    dist: {
        options: {

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

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

非常感谢所有帮助

【问题讨论】:

  • 我不确定 uncss 是否可以像您编写的 src: '/application/views/includes/header.php' 那样处理 php 文件
  • 所以你认为只是 header.php ?
  • 根据 grunt-uncss 插件文档 (github.com/addyosmani/grunt-uncss),您对 uncss 任务的配置可能有误。
  • 感谢@Eria,我再次阅读,我知道他们使用进程 html,但这是一个 codeigniter php 项目

标签: php codeigniter gruntjs uncss


【解决方案1】:

在谷歌进行一些研究后,我将得出结论,你不能为 uncss 使用动态 php 文件(正如我在上面的评论中所说)。

你应该为uncss生成页面的html结果或使用页面链接代替。

请阅读这篇文章(它是关于 Wordpress,但你应该了解基本概念)

Liam Gladdy blog article about uncss

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多