简体   繁体   English

DotNet-MVC:测试验证CSS最小化

[英]DotNet - MVC: Testing for validating css minification

I need to test that all CSS/SCSS files in a project have been successfully minified in the build process of a .Net MVC App, or at least test that they are valid CSS. 我需要测试项目中的所有CSS / SCSS文件是否已在.Net MVC App的构建过程中成功缩小,或者至少要测试它们是否为有效的CSS。

Currently, the project is built in VSO/VSTS, and syntax errors in the CSS will not fail the build, and the app is deployed with broken CSS. 当前,该项目是在VSO / VSTS中构建的,并且CSS中的语法错误不会使构建失败,并且使用损坏的CSS部署了该应用程序。

I know very little about .Net apps, I know that the main project is ProjectName.Web, the tests are ProjectName.Web.Test, and if I want to test something, I create a corresponding "-Test" class in the ".Test" project, but where would I put a test for minification of files? 我对.Net应用程序了解甚少,我知道主项目是ProjectName.Web,测试是ProjectName.Web.Test,如果要测试某些东西,可以在“中创建一个对应的” -Test“类。测试”项目,但是我应该在哪里进行文件最小化测试? The files are bundled in ProjectName.Web/App_Data/BundleConfig, and use BundleTransformer to minify the files, how do I check it worked correctly after build? 这些文件捆绑在ProjectName.Web / App_Data / BundleConfig中,并使用BundleTransformer缩小文件,如何在构建后检查其是否正常工作?

Any pointers are welcome! 任何指针都欢迎!

Here is a link to de-minify css. 是缩小CSS的链接。 I would recommend you de-minify it, identify the problems, then minify it again. 我建议您缩小尺寸,找出问题,然后再缩小尺寸。 Usually they are small things. 通常它们是小东西。 If you can post the deminified code then I would be happy to help. 如果您可以发布缩小的代码,那么我们将很乐意为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM