Base solution for your next web application
Open Closed

style.bundle.css now minified making development difficult #12536


User avatar
0
rickfrankel created

Hi,

Since 14.2.0 the style.bundle.css files in the \src\assets\metronic\themes folders are now minified.

It makes it really difficult to debug. Especially when trying to understand what changes have been done and what the new theme classes we should use are.

Is there a reason for them being minified now in the raw source? Can they be made non-minified in the source control and then minified as part of the build process?

Thanks Rick

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @rickfrankel

    The minified versions of bundle files are used for performance optimization. In the development environment, when you run the bundle command, these files and other .min files will be generated, but their contents will not be compressed. Compression only takes place when the production bundle command is executed. However, in Angular, the Metronic bundle files are already provided in a minified state by default. If you prefer, you can unminify these bundle files and configure their paths in the bundles.json file. This, however, requires a custom modification.

    In the bundles.json file, you should add style.bundle.css as the input and specify its .min version as the output.

    To make the application use this minified version, you also need to update the DynamicResourcesHelper so that when it references style.bundle, it points to the minified file.

    Note: It is not recommended to modify the Metronic bundle files, as they are updated when Metronic itself is updated.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    rickfrankel created

    Thanks @oguzhanagir. I just noticed that it had changed was all.

    We don't modify the metronic bundles but I can never remember what the different classes are for things like padding right etc. So always used to refer to the styles.bundles.css file to remind myself what they were.

    It is also helpful when trying to debug issues with the upgrades. As styles change in Metronic they are not always updated in the new version and they are definitely not updated in the hundreds of components we have built ourselves. So we often have to find what has changed and then do find and replaces to upgrade our components to new styling/classes.

    Thanks for now I'll just unminify it myself and add it as a reference file to our project so we can refer to it.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)