Fis3 is a very good front-end optimization tool, powerful, in the domestic is also more popular. Visual Studio and MSBuild are needless to say. However, there is no one who wants to incorporate FIS3 into the development process of visual Studio or MSBuild. The reason is because FIS3 will change the HTML page itself, including template files, such as aspx, cshtml, PHP files and so on, but these files belong to the source file, it should not be changed. However, the publishing features of Visual Studio (publish) or Msbuild+msdeploy provide the possibility to combine FIS3 (hereinafter referred to as MS Tools). Because in these processes, the MS Tool produces intermediate files on which the FIS3 tool can be applied to optimize changes to the relevant files.
I tried according to the above ideas, the effect is good. The main difficulty is to familiarize yourself with the syntax of MSBuild, the build and publish processes of Visual studio, and some of the knowledge of Ms Web Deploy.
About Ms Web Deploy:
- ASP. NET WEB application Project Deployment.
- Web Deployment Overview for Visual Studio and ASP.
Specific details are still many, here, I introduce the effect and feelings.
- Default.aspx pages in an ASP. NET project open in Visual Studio:
- The Fis-conf.js file configured for this project :
- One-click Publishing in VS. You can publish to the native IIS or any remote machine with the WMSVC service installed. If it is published in this machine, it is also convenient to perform native debugging. Note that I am here to publish to this machine IIS, the receive side setting is : Http://localhost:8172/msdeploy.axd
- VS. Results published in the IDE
- VS. Results published in the IDE. View the source code for the page. As you can see, CSS files and JS files have been merged (that is, aio.css, aio.js files), but no other optimizations have been made.
- In addition to publishing in the VS IDE, command-line publishing is also important. The ability to perform command-line publishing is a feature that implements continuous integration (CI).
- I added more Fis3 optimizations in command-line publishing, including: JS and CSS compression, image sprite. Of course, these optimizations can also be made in the IDE's release. In this figure, you see that the CSS on the page is compressed. And the sprite was made.
- CSS files are merged and are sprite-formatted. JS files are merged and compressed.
FIS3 and Visual Studio/msbuild integration, can not only optimize the performance of the Web site, but also improve the efficiency of developers, is a very good thing, there is a need for the company, can ask me for consulting services, contact information: http://weibo.com/u/ 1999451503**
Thanks for reading
Integrated visual Studio/msbuild Publish and FIS3