2013-07-29 27 views
3

我添加一些代碼來mixins.less:爲什麼在編譯Bootstrap 3 RC1時給Grunt/Recess一個錯誤而Lessc不是?

img { &:extend(.img-responsive); } 

參見:Images not responsive by default in Twitter Bootstrap 3?https://stackoverflow.com/a/15573240/1596547

當我在命令行中我得到運行grunt dist

Running "recess:bootstrap" (recess) task 
>> Parser error in less/mixins.less 
>>  549. img { 
>>  550. &:extend(.img-responsive); 
>>  551. } 
Warning: Use --force to continue. 

Aborted due to warnings. 

但是當我編譯它與Lessc:​​我沒有發現錯誤。 (lessc 1.4.2(LESS Compiler)[JavaScript] )

&:extend needs less 1.4.0。那麼咕嚕/隱藏使用不同的編譯器?

更新 運行install grunt-contrib-less --save-dev給出:

[email protected] node_modules/grunt-contrib-less 
├── [email protected] ([email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 

所以我希望少5.0上,但仍然得到這個錯誤

+0

同樣的問題,因爲你的現在。你設法使它工作? – darksoulsong

+0

對不起,我不知道。我運行Bootstrap 3.1.1。在這一刻。我只在3.0 RC1 –

回答

0

這取決於grunt-contrib-less的版本,你有。

運行:

npm update grunt-contrib-less 
+0

中發現此問題,感謝您的回覆。我嘗試過,但仍然得到相同的錯誤 –

+0

你的gruntfile仍然指的是如何編譯少的休會。這還需要更新,否則它仍然會使用隱藏進行編譯。 – Case

相關問題