问题
When publishing a Web Application (MVC in my case) via File System
in 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