Compile Sass files in IIS7

坚强是说给别人听的谎言 提交于 2020-01-25 04:31:06

问题


I have encountered a problem in compiling Sass (.scss) files on IIS7. Is there any simple way to invoke the compilation? I have tried to add the MIME type but it wasn't working. Do I have to install something additional to IIS server?

I have also installed Mindscape instead of SassyStudio ad-on to Visual Studio and it did help because of dynamic .scss compilation. As you save .scss file, Mindscape generates .css file. But is there a posibility to run such compilation during deployment or on the IIS server?


回答1:


Firstly Sass is a pre-processor, therefore must to be compiled to CSS to be used by the browser and IIS.

You have a few options:

  1. Compile to css within Visual Studio and add the CSS to the project.

  2. Have your build server/process compile to CSS before deploying to your environment. A common way to do this is with a Grunt or Gulp script.

  3. Use BundleTransformer for Sass and create bundles with your .scss files. The transformer will output the bundle compiled to CSS.



来源:https://stackoverflow.com/questions/36286092/compile-sass-files-in-iis7

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