Why does `middleman serve` work, but `middleman build` fails to compile this Sass?

纵饮孤独 提交于 2019-12-05 11:03:59

This turned out to be due to some files that aren't meant to be output having names that do not start with an underscore. E.g., content.css.sass should be _content.css.sass, so that middleman knows not to try to build that file directly. (We aren't really familiar with middleman etc. - this was a bundle handed to us, so it took a while to track this down.)

So I bumped into this and wanted to give a more precise answer:

Any @imported file in the chain downstream from a non-underscore named file will break with an error such as Sass::SyntaxError Undefined Variable or Undefined mixin.

It's as simple as making sure every file in the chain starts with an underscore; sometimes very easy to pass by!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!