Minifier Reloaded
Pre-releaseWARNING: Highly experimental release. Pretty much guaranteed to be buggy.
Finally, it's here! I have finally been able to rewrite the script composing system, as well as a complete revamp of the minifier. Of course, as the very first release, this is bound to have bugs galore. The minifier is also rather slow, the larger scripts may take minutes to deploy.
Make sure your visual studio is fully updated or this extension won't work.
Reporting Bugs
Please report problems using the Issues section, and prefix your issue with [Pre].
Features
- Automatically remove type definitions that are not in use by the script
- Control the placement of individual .cs files in relation to each other
- The minifier now supports unminified sections
- Add deployment date and time information to your scripts via macros
- Decide whether you want the blueprint dialog to show after deployment (under tools/options/MDK/SE)
File Sorting Order
You can now control where each individual .cs files are placed in relation to each other by adding
// <mdk sortorder="100" />
at the very top of the code files you wish to control, even above the using
statements. The sortorder number will be used to determine the orders of the files. You can also use negative sortorders to force files above the Program class. Of course, certain rules will be above even the sortorder: The readme.cs
file will always be on top no matter what, and classes that is not inside a partial class Program
will by necessity have to be at the bottom simply due to how such classes work.
Deployment Date and Time Information
In order to both try to save a little time and to make sure these macros don't mess up any code, they only work inside special code regions.
#region mdk macros
// This script was deployed at $MDK_DATETIME$
const string Deployment = "$MDK_DATE$, $MDK_TIME$"
#endregion
Unminified Section
The unminified section system also works by code regions. Simply add the code or comments you wish to preserve within such a region to have the minifier skip over it. Be aware though, that it won't necessarily be completely untouched. Some minor adjustments might be made, but naming will be untouched, and formatting will most probably be.
#region mdk preserve
// Stuff I don't want the minifier to touch
#endregion