12/29/2023 0 Comments Visual studio minify javascript![]() Only minify your own Javascriptfiles in your build process. Don’t attempt to minify 3rd party files in your build process. So basically, if you’re including 3rd party Javascript files, make sure you add them to your Visual Studio project in minified form (unless you’re using a CDN of course). This has now solved the problem, and everything works perfectly again. I then excluded it from the bundleconfig.json minification process. I managed to solve the problem by manually minifying the culprit Javascript file and adding it to the project in its minified form. I excluded this step from the build process to check, and sure enough, the culprit was definitely this build command. This command was recreating the file, but failing to include all the files specified in the bundleconfig.json with the exception of the un-minified 3rd party Javascript file. All of the other files we were minifying had somehow been removed from the resultant file.Īfter much investigation I narrowed down the issue to the following command in our build pipeline. Looking at the file that was on the build and test servers, it became apparent that the file contained only the contents of the un-minified 3rd party Javascript file. This seemed strange, as everything had been working perfectly, and all we had done was check in a few Javascript files. Whilst I was testing the latest version of the app I was getting all sorts of errors in the browser as many of the Javascriptfunctions were not being found. The bundleconfig.json minifies several Javascript files and outputs the aggragated file as. So we added the file to bundleconfig.json in Visual Studio so that our build process would minify the file. The majority of the files for this 3rd party library were already minified, with the exception of one.įor some reason this one particular Javascript file was not minified. These were 3rd party Javascript files to add support for drag & drop. A colleague of mine who was working on some new functionality, had checked in several Javascript files. I recently came across some strange behaviour in our ASP.NET Core 2.2 web application. Weird Minification Behaviour in ASP.NET Core
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |