✨ New flag devel.webassets.minify_plugins

As suggested in @b-morgan in #3638, to allow plugin authors to detect
minification issues with their code during development.

See also #3640
This commit is contained in:
Gina Häußge committed 2020-07-13 14:22:29 +02:00
1 parent 6bac39c193
commit 2a4853bbd4
3 files changed
+11 -3

No files matched your search

+5 -1
View File
@@ -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
+4 -1
View File
@@ -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"""
+2 -1
View File
@@ -415,7 +415,8 @@ default_settings = {
"webassets": {
"bundle": True,
"clean_on_startup": True,
"minify": True
"minify": True,
"minify_plugins": False
},
"useFrozenDictForPrinterState": True,
"showLoadingAnimation": True,