Commits

David Carr  committed 90d20a1

bundling: change configuration from grails.plugins.pageResources.bundlePageResources to grails.plugins.pageResources.defaultBundle

This has a couple advantages. First, the naming is now more similar to how things are named in the resource plugin, which should make it
easier for users to remember and understand. Second, the behavior has been enhanced so that now, instead of only supporting true/false,
it also supports String values, in exactly the same way as configuring defaultBundle in a resource module manually. The user experience
should now be that setting a value in this config key has the same effect as if they had included an equivalent defaultBundle entry in each
page module manually.

  • Participants
  • Parent commits a80b381

Comments (0)

Files changed (2)

File grails-app/conf/ZZZPageResources.groovy

                         if (dependModule) {
                             dependsOn(dependModuleName)
                         }
-                        if (!config.grails.plugins.pageResources.bundlePageResources) {
+                        def defaultBundleVal = config.flatten().get('grails.plugins.pageResources.defaultBundle')
+                        if (defaultBundleVal instanceof String) {
+                            defaultBundle(defaultBundleVal)
+                        } else if (!defaultBundleVal) {
                             defaultBundle(false)
                         }
-
                         files.each { file ->
                             def url = file.path.substring(prefixLen).replaceAll('\\\\', '/')
                             resource(url: url)

File src/docs/guide/usage.gdoc

 attempting to reduce the number of page modules you use.
 {note}
 
-If you want to allow bundling to occur, add the following to your @Config.groovy@:
+If you want to allow auto-bundling to occur, add the following to your @Config.groovy@:
 
 {code}
-grails.plugins.pageResources.bundlePageResources = true
+grails.plugins.pageResources.defaultBundle = true
 {code}
+
+Alternatively, if you want all page modules to use a single bundle, you can set this configuration key to a String value, which
+will be passed to the resources plugin as the argument to defaultBundle for every page module.