The reason for using a Windows Form application is simple, no need to leave Visual Studio or depend on a Visual Studio extension which may not be supported in later versions of Visual Studio. Also, a developer having simply source code can easily modify the code, for instance, change options and also change the executable called which can also be depreciated. Another reason for using this utility, no need to remember options sent to the utility.
- The tool has been configured to work for ASP.NET Core or Razor Pages projects only but the code is easy to modify for other project types.
Best to install globally using the following command via PowerShell window.
npm install uglify-js -g
- Clone the source repository
- Open the solution in Visual Studio 2022 or later
- Build the project
From Visual Studio Tool menu
- Click External Tools...
- Click the Add button and fill in the inputs
- Title: MinifierCompressor (or whatever you want)
- Command: Select the .exe for this project
- Arguments: $(ProjectDir)
- Click Save
Select a file and click Execute button. The update can be seen immediately in Solution Explorer.
Results for selected file.
Could have but want to keep it simple. If a developer is not comfortable altering code for this and I get enough request I will modify to permit multiple files at once.
Clone the following GitHub repository.