grails-coffeescript-resources

所属分类:人工智能/神经网络/深度学习
开发工具:Groovy
文件大小:74KB
下载次数:0
上传日期:2013-04-08 07:41:58
上 传 者sh-1993
说明:  另一个用于Grails的CoffeeScript编译器
(Another CoffeeScript compiler for Grails)

文件列表:
CoffeescriptResourcesGrailsPlugin.groovy (1520, 2013-04-08)
LICENSE.txt (9642, 2013-04-08)
application.properties (161, 2013-04-08)
grails-app (0, 2013-04-08)
grails-app\conf (0, 2013-04-08)
grails-app\conf\BuildConfig.groovy (945, 2013-04-08)
grails-app\conf\Config.groovy (997, 2013-04-08)
grails-app\conf\DataSource.groovy (1168, 2013-04-08)
grails-app\conf\UrlMappings.groovy (180, 2013-04-08)
grails-app\resourceMappers (0, 2013-04-08)
grails-app\resourceMappers\CoffeeScriptResourceMapper.groovy (1897, 2013-04-08)
grails-app\views (0, 2013-04-08)
grails-app\views\error.gsp (1601, 2013-04-08)
plugin.xml (1349, 2013-04-08)
scripts (0, 2013-04-08)
scripts\_Events.groovy (103, 2013-04-08)
scripts\_Install.groovy (38, 2013-04-08)
scripts\_Uninstall.groovy (210, 2013-04-08)
scripts\_Upgrade.groovy (420, 2013-04-08)
src (0, 2013-04-08)
src\groovy (0, 2013-04-08)
src\groovy\org (0, 2013-04-08)
src\groovy\org\grails (0, 2013-04-08)
src\groovy\org\grails\plugins (0, 2013-04-08)
src\groovy\org\grails\plugins\coffeescript (0, 2013-04-08)
src\groovy\org\grails\plugins\coffeescript\CoffeeScriptEngine.groovy (2068, 2013-04-08)
src\groovy\org\grails\plugins\coffeescript\coffee-script-1.6.1.js (197423, 2013-04-08)
test (0, 2013-04-08)
test\integration (0, 2013-04-08)
test\integration\org (0, 2013-04-08)
test\integration\org\grails (0, 2013-04-08)
test\integration\org\grails\plugins (0, 2013-04-08)
test\integration\org\grails\plugins\coffeescript (0, 2013-04-08)
test\integration\org\grails\plugins\coffeescript\CoffeeScriptEngineTests.groovy (785, 2013-04-08)
test\integration\org\grails\plugins\coffeescript\example.coffee (414, 2013-04-08)
web-app (0, 2013-04-08)
web-app\WEB-INF (0, 2013-04-08)
... ...

This is a grails plugin that enables the easy inclusion of [CoffeeScript](https://github.com/jashkenas/coffee-script) in your Grails web application. It requires the well established resources plugin. ## Background As the author, [Jeremy Ashkenas](https://github.com/jashkenas), says himself "CoffeeScript is a little language that compiles to JavaScript". CoffeeScript is an attempt to make writing JavaScript easier, more elegant, and more efficient. The standard CoffeeScript compiler runs on NodeJs. This plugin is basically a bridge (via Mozilla's [Rhino engine](https://github.com/mozilla/rhino)) to a browser compatible version of the compiler released by Jeremy Ashkenas. It uses CoffeeScript version 1.2.0. ## Usage To add coffee script resources to your grails project * Install the plugin * Actually add your CoffeeScript files to your project. I placed mine adjacent to the js folder in cs. * Reference your CoffeeScript files in your ApplicationResources file (or where ever you are defining your resources). Example
js {
  resource url: 'js/app.js'
}
coffee {
  resource url: 'cs/views.coffee'
  resource url: 'cs/models.coffee'
}
Files should be located:
- web-app
 - js
    - app/.js
 - cs
    - views.coffee
    - models.coffee
The above example will create a resource you can include in pages or have another resource depend on. The CoffeeScript files are converted to JavaScript, and included like any of your JavaScript files. The default disposition for your CoffeeScript follows the JavaScript default: "defer" - that is they will appear at the end of your page. ## Problems Every resource module is compressed to bundle. By default .coffee files are not added to any bundle. In order to have it in the bundle you must explicitly declare bundle attribute for the resource line or defaultBundle for the module.
  modules {
    example1 {
      defaultBundle 'example1'
      resource url: 'cs/test.coffee'
    }

    exmaple2 {
      resource url: 'cs/test.coffee', bundle: 'example1'
    }
  }
Plugin doesn't apply when you have enabled debug mode for resource plugin:
grails.resources.debug = true
It's because resource plugin disable processing, when debug is enabled, see [resource plugin docs](http://grails-plugins.github.com/grails-resources/guide/8.%20Debugging.html)

近期下载者

相关文件


收藏者