I'm writing my first Grails (2.3.6) app and need to use the following libraries:
I would like to configure these libraries from inside a web-app/js/application.js
file. I'm not sure if I should:
- Manually add the libraries to my
web-app/js/
directory, and then import them as<script>
elements from inside my GSP (see below); or - Pull them in from
BuildConfig.groovy
.
With the former approach:
// Inside index.gsp:
<body>
<script type="text/javascript" src="${resource(dir: 'js', file: 'signals.min.js')}" />
<script type="text/javascript" src="${resource(dir: 'js', file: 'crossroads.min.js')}" />
<script type="text/javascript" src="${resource(dir: 'js', file: 'hasher.min.js')}" />
<script type="text/javascript" src="${resource(dir: 'js', file: 'application.js')}" />
</body>
With the latter approach:
// Inside BuildConfig.groovy:
plugins {
runtime: ":signals:???"
runtime: ":crossroads:???"
runtime: ":hasher:???"
}
Which way is the right way to go with Grails, and why? And, if the latter approach is the generally-accepted method, what values do I need for each runtime
entry?