13

I am searching for a solution for compiling my .scss files at run-time and at compile-time.

The reason I need both is that our designers work on Macs and prefer the ease of having their .scss files compiled dynamically at run-time (especially during a development phase). On the other hand, I need compile-time support to validate that the SCSS compiles successfully during my build process. My goal is to fail a build if the SCSS doesn't compile.

I have found several libraries available on NuGet, however, minor flaws in each of them are holding me back.

Is there a solution available for both of these scenarios?

Here's where my research has led me:

Run-time Support

Compile-time support:

  • Cassette.MSBuild (Does not appear to bundle SCSS files, only CSS)
  • Mindscape Web Workbench (Pro version apparently includes a command-line tool, however, documentation is very limited on the feature)
  • Others?
4

2 回答 2

4

Mindscape Web Workbench的专业版包括一个用于在运行时编译的命令行工具。目前,只有夜间构建能够编译 Bourbon 和 Neat(我的要求之一)。

这是我的预构建活动,目前效果很好:

"C:\Program Files (x86)\Mindscape\Web Workbench\Command Line\wwcmd.exe"
"$(ProjectDir)scss\style.scss" /o:../css /style:compressed

更新:

我们决定简单地从预构建事件中调用 SASS,而不是使用 Web Workbench。

call sass -C "$(ProjectDir)assets\scss\main.scss" "$(ProjectDir)assets\css\compiled\main.css" --style compressed
于 2013-10-11T19:00:35.977 回答
1

查看SassAndCoffee。这是 Cassette 正在使用的东西,它将所有内容嵌入到几个程序集中。

另一方面,Web Workbench 实际上将 ruby​​ 和 sass gem 安装到文件系统中,隐藏在当前用户目录下的一个很长的文件夹路径中,这对于 Web 应用程序以及安全性和权限而言可能很麻烦。

于 2013-06-18T07:40:37.360 回答