Web Resource Minification.

Minifying your JavaScript and CSS files can decrease loading times and improve user experience. At the same time, during development this can also make it more difficult to read and debug.

Starting with v2.0, XrmToolkit solves this issue by giving you several options. You can now specify minification options based on the following:

  • Never
  • Always
  • Only in Release Mode

These options can now be set on a per-file, and per-organization basis. This allows the greatest flexibility and control over how each file is published to CRM. If you have a file like JQuery that you know you will never try to debug, you can set it's minification option to 'Always'. If on the other hand, you have 2 organizations linked to your Visual Studio solution, a dev environment and a production environment, you can set all the dev files to 'Never' be minified, while setting the same files to 'Always' minify when you are logged into the production environment.

The 'Only in Release Mode' option allows you to control the minification of files based on the currently selected Visual Studio build configuration. JavaScript and CSS files will only be minified when the build configuration is in 'Release' mode:

When creating a new Web Resource project, the default minification options are copied from the global options found here marked as number 7.

However, while downloading the files from CRM, you can set the minification options from that window as well. To learn more see the documentation found here.

These settings will be remembered the next time you download additional web resources from the same project and organization.