2014-02-23 52 views
2

我无法将“主”bootstrap.less编译为'<%= pkg.name %>.css'。我得到这个错误运行grunt less使用Grunt无法编译Bootstrap 3 LESS主文件(bootstrap.less)?

Running "less:dist" (less) task 
>> ParseError: Syntax Error on line 643 in bower_components\bootstrap\less\mixins.less:643:25 
>> padding-right: (@grid-gutter-width/2); 
>> &:extend(.clearfix all); 
>> } 
Warning: Error compiling LESS. Use --force to continue. 

Aborted due to warnings. 

我对less任务配置相当简单:

less: { 
    options: { 
     strictMath: true 
    }, 
    dist: { 
     files: { 
      'dist/assets/css/<%= pkg.name %>.css': [ 
       '<%= bootstrap_less %>/bootstrap.less', 
       'src/assets/less/style.less' 
      ] 
     } 
    } 
}, 

// Arbitrary properties used in task configuration templates. 
bower_components: 'bower_components', 
bootstrap_less: '<%= bower_components %>/bootstrap/less' 

mixins.less错误行(不以任何方式由我修改):

// Centered container element 
.container-fixed() { 
    margin-right: auto; 
    margin-left: auto; 
    padding-left: (@grid-gutter-width/2); 
    padding-right: (@grid-gutter-width/2); 
    &:extend(.clearfix all); 
} 

请不要,我是新来的Grunt,也许我失去了一些东西。

+0

用'--verbose'运行grunt,看看它说了什么。您最近是否更新过任何(凉亭)套餐?可能是一种更少的“依赖性”的突破性改变。 –

回答

3

也许您的less版本已过时? :extend()是Less的新功能。

+0

我已经用grunt-contrib-less独自替换了grunt-contrib(整个软件包),而不是它正在工作。谢谢! – gremo

相关问题