Laravel 4,Basset,Less-preg_match编译失败

瑞安

背景:我正在使用Ubuntu 12.04,PHP 5.5.1-2和Laravel 4。

当我跑步时:

php artisan basset:build

我得到了错误

{"error":{"type":"ErrorException","message":"preg_match(): 
Compilation failed: nothing to repeat at offset 0",
"file":"\/home\/ryan\/MyApp6\/vendor\/jasonlewis\/basset\
/src\/Basset\/Filter\/Filter.php","line":241}}

我的问题与此类似:如何在laravel 4中减少使用贝塞琴的工作量?

但是,我已经尝试了LessphpFilter,并且已经安装了node.js ...我可以使用node手动编译样式表,但是都不能通过bassette对我起作用。

例如,给定mytest.less:

@color:blue;
body{
    background-color: red;
    color:@color;
}

MyApp / app / config / packages / jasonlewis / basset / config.php

'collections' => array(

    'mytest-css' => function($collection)
    {

        $collection->directory('assets/bs3/css', function($collection)
        {
            $collection->add('../less/mytest.less')->apply('Less');            
        })->apply('UriRewriteFilter')->setArguments(public_path());
    },
...

当我在浏览器中上拉页面时,背景为红色,但文本仍为黑色。在Chrome devtools中,我可以看到已编译的CSS文件,但内容仍然是:

@color:blue;

body{
    background-color: red;
    color:@color;
}

我究竟做错了什么?甚至有关如何跟踪此问题的提示也将不胜感激-谢谢!

瑞安

LessphpFilter是我需要的,在app / config / packages / jasonlewis / basset / config.php中

我还需要添加一个斜杠,如下所示:

'Less' => array('LessphpFilter', function($filter)
{
    $filter->whenAssetIs('/*.less')->findMissingConstructorArgs();
}),

希望对您有所帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Laravel preg_match():找不到结尾定界符“ /”

Laravel preg_match():未知修饰符']'

preg_match():未找到结尾定界符“ /”,Laravel

PHP正则表达式转义字符错误:“ preg_match():编译失败:缺少”

WordPress警告:preg_match():编译失败:在偏移量1处无法重复

警告preg_match():编译失败:在偏移量33处无法重复

preg_match():编译失败:字符类中偏移量 20 处的范围无效

Laravel后端验证preg_match():未知修饰符'?' 使用正则表达式

LARAVEL电话以05或06开头“ preg_match():未找到结束定界符'/'”

preg_match():编译失败:\ x {}或\ o {}中的字符值在第25行的偏移27处太大

laravel preg_replace函数编译失败:无效的范围在字符类

在openwrt的php4中未定义preg_match?

图片网址preg_match失败,无法找出原因

php:preg_match失败,出现特殊字符模式

Laravel 4 Excel导入失败

preg_match的通配符

多行Preg_match

CI 3.0.4大where_in查询导致原因消息:preg_match():编译失败:正则表达式在偏移处太大)

PHP中的正则表达式返回preg_match():编译失败:PCRE不支持\ L,\ l,\ N {name},\ U或\ u

在Laravel验证正则表达式规则中验证纬度/经度-preg_match():找不到结尾定界符'/'

Laravel 4-外键约束失败

PHP preg_match空行

preg_match检索值

php的preg_match日期

preg_match并删除字符

JavaScript中的preg_match?

preg_match特殊字符

preg_match()函数的问题

Preg_match回溯错误