diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index f96751326..9b2fc337c 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -283,10 +283,14 @@ The following settings are only relevant to you if you want to do OctoPrint deve # false, no minification will take place regardless of the minify setting below. bundle: true - # If set to true, OctoPrint will minify its viewmodels (that includes those of plugins). Note: if bundle is + # If set to true, OctoPrint will the core and library javascript assets. Note: if bundle is # set to false, no minification will take place either. minify: true + # If set to true, OctoPrint will also minify the third party plugin javascript assets. Note: if bundle or + # minify are set to false, no minification of the plugin assets will take place either. + minify_plugins: false + # Whether to delete generated web assets on server startup (forcing a regeneration) clean_on_startup: true diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index 4101e8046..2f667995d 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1606,7 +1606,10 @@ class Server(object): filters.append("gzip") js_filters = filters - js_plugin_filters = [x for x in js_filters if x not in ("rjsmin",)] + if self._settings.getBoolean(["devel", "webassets", "minify_plugins"]): + js_plugin_filters = js_filters + else: + js_plugin_filters = [x for x in js_filters if x not in ("rjsmin",)] def js_bundles_for_plugins(collection, filters=None): """Produces JsPluginBundle instances that output IIFE wrapped assets""" diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index c43c5b2db..485cf1738 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -415,7 +415,8 @@ default_settings = { "webassets": { "bundle": True, "clean_on_startup": True, - "minify": True + "minify": True, + "minify_plugins": False }, "useFrozenDictForPrinterState": True, "showLoadingAnimation": True,