To ease the development of the JavaScript. Nimble provide a mechanism to allow the development JavaScript, CSS, and images to be hosted and served by Tomcat directly from the /src/js/* and /src/css/* folders. This allows for the modifications during development to quickly show the results of any changes made. This may not seem that unique, but taken in the context that Nimble also provides compile time css and JavaScript minification. This means that during development the browser sees /src/* files and in production the browser sees /web-app/* files as expected. This feature is turned on by default and can be turned off by adjusting the development environment in the /grails-app/conf/NimbleConfig.gsp of your project directory.Configuring Development Virtual Directories environments { developement { nimble { resources { usejsdev = false usecssdev = false } } } } This feature works first by creating the aliases (virtual folders) to the development code in the {Nimble}/scripts/_Events.gsp file. Using the ConfigureTomcat event. The following code does that. eventConfigureTomcat = {tomcat -> The createVirtualDirectory closure can be found in the _Events.gsp file also.if(GrailsUtil.environment=="development") createVirtualDirectory(tomcat,"dev",'./src') } Configuring Compile Time JavaScript/CSS Minification The compile time minification is configured in the {Nimble}/grails-app/conf/BuildConfig.gsp file. To turn it all off use the following code on your projects BuileConfig.gsp nimble { resources { nomodcheck = true // turn off modification checking nocompress = true // turn off compile time minification noclean = true // turn off /web-app/ directory cleaning } } The noclean property is not worthy because this keeps Nimble from clearing the output that was created in a previous compile run. It is suggested that you compile your project at least once before using before mention configuration items. If you do not, Nimble will not be able to find the resources it needs. |