Do not copy SASS / LESS file when using Web Publish

大兔子大兔子 提交于 2021-02-08 01:48:05

问题


When publishing a Web Application (MVC in my case) via File Systemin Web Publish setting, most of the *.scss & *.less files get deployed as well.

How do I configure a Visual Studio project so that it does not deploy these files?


回答1:


I believe setting "Build action" to "None" and "Copy to output directory" to "Never" should work. You can do it in property window of the file. Right click the file in solution explorer and click properties




回答2:


Visual Studio deploys only those files that are included in the project, visible in project explorer and also "Build Action" ="Content" configured with "Copy to Output Directory" = "Copy Always" or "Copy if newer" then on publish, such files are copied to output directory.

As *.scss & *.less are just configuration files that are used to generate final output files to be available in output directory and so these never required in production after publish, but as these files required to be included in project file so these files should have properties configured as: Build Action: Content Copy to Output Directory: Do not copy



来源:https://stackoverflow.com/questions/37660420/do-not-copy-sass-less-file-when-using-web-publish

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