When generating a bundle via plone-compile-resources, how to prevent minifying?

Hi folks

I'm generating a bundle via plone-compile-resources like so:
./bin/plone-compile-resources --site Plone --bundle xmpp

The bundle gets generated minified/uglified. How can I generate the bundle un-minified? I set "development mode" on in the control panel but that didn't make a difference.


Sometimes the bundle is generated minified, and sometimes not, which is quite confusing.

It was just generated unminified, so I turned development mode off to see whether it was indeed that setting, but then after regenerating it's still unminified.

you can rename or copy your js files to .min.js and Plone code will get that it's already minified even if it's not. You have also of course to edit your resources to point at the changed name. HTH

you can rename or copy your js files to .min.js and Plone code will get that it’s already minified even if it’s not.

I'd prefer to have a solution which is not a hack (no offense intended).

I've noticed something. If I make a build from the CLI after making a build in Plone, then the built file is un-minified, otherwise it's minified.

absolutely no offense, it is a hack :slight_smile:. I'll still prefer it to your hack.

Thinking back about your first post on the subject, I think that what you have to do is but your bundle in dev mode too, see this post:

@jcbrand the answer lies in the Gruntfile.js in your buildout root which is generated by: https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/_scripts/_generate_gruntfile.py

AFAIK JS files are always un- and minified. CSS files are always minified. An option to take control over that would be nice.

1 Like

Thanks @thet!