grails javascript asset executes every page load without even being 'called' -
i need javascript libraries in grails project. read putting file in grails-app/assets/javascripts , calling <asset:javascript src="myjsfile.js"/>
way go. however, notice without putting <asset:javascript src="myjsfile.js"/>
anywhere in project, file executes every page load...
i notice problems seem disappear if remove line in grails-app/javascripts/application.js: //= require_tree .
feels i'm doing wrong...
i don't understand documentation (https://grails.org/plugin/asset-pipeline) enough know i'm doing wrong. know?
the //= require_tree .
says manifest should include files in directories starting root javascript directory assets.
so, when remove it's going no longer pick of javascript files part of manifest. gets included in pages.
if want fine grained control on included in manifest you'll have remove existing //= reuire_tree .
, specify individual assets or configure plugin ignore javascript entirely (which wouldn't recommend).
spend more time documentation it's explained in detail in there.
Comments
Post a Comment