David Carr avatar David Carr committed c88a86a Merge

Merge pull request #6 from alvarosanchez/master

There's now a new configuration option to allow bundling resources in page resource modules.

Comments (0)

Files changed (5)



 import org.springframework.core.io.FileSystemResource
 class PageResourcesGrailsPlugin {
-    def version = "0.1.2"
+    def version = "0.2.0"
     def grailsVersion = "1.3 > *"
     def dependsOn = [resources: "1.2-RC1"]
     def pluginExcludes = [
     def scm = [ url: "https://github.com/davidmc24/grails-page-resources/" ]
+    def developers = [
+        [name: "Álvaro Sánchez-Mariscal", email: "alvaro.sanchez@salenda.es"]
+    ]
     def watchedResources = [
         "file:./web-app/pages/**/*.*" // Watch for page resource changes


 def log = LoggerFactory.getLogger('org.grails.plugin.resource.page.PageResources')
 def application = ApplicationHolder.application
+def config = application.config
 ResourceProcessor grailsResourceProcessor = application.mainContext.getBean('grailsResourceProcessor')
 modules = {
                         if (dependModule) {
-                        defaultBundle(false)
+                        if (!config.grails.plugins.pageResources.bundlePageResources) {
+                            defaultBundle(false)
+                        }
                         files.each { file ->
                             def url = file.path.substring(prefixLen).replaceAll('\\\\', '/')
                             resource(url: url)


 Below is the history of Page Resource plugin releases.
+h4. 0.2.0 (Release XXX)
+* Added a configuration option to bundle all page resources together.
 h4. 0.1.2 (Release 7-31-2012)
 * Fixed IllegalArgumentException on unsupported files in pages directory ( "Issue #2":https://github.com/davidmc24/grails-page-resources/issues/2 )
 * Fixed loading of new page resource files ( "Issue #4":https://github.com/davidmc24/grails-page-resources/issues/4 )


 Another option is to [override resources|http://grails-plugins.github.com/grails-resources/guide/5.%20Overriding%20resources.html]
 in the automatically defined page module.
+h4. Bundling all page resources
+By default, page resources will be served to the browser each on one file. If you want to bundle all of them together,
+just add the following to your @Config.groovy@:
+grails.plugins.pageResources.bundlePageResources = true
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.