javascript - RequireJS text plugin - minification of templates -


i'm using text plugin import templates. now, in production don't want there many xhr requests templates them in 1 go. idea have build task take template , create like:

define("my-template.tpl", function() {     return '<div>my content</div>' } 

and able , define statement has been run, requirejs still xhr request when have

define("my function", ["my-template.tpl"], function() {     <body of function here> }); 

did minification of text! plugin templates? doing wrong here?

requirejs requests modules asynchronously.

if want 1 single call, can build app using optimizer. not need template wrapper (as noticed yourself, won't change anything). files required using text plugin included in built file too.


Comments

Popular posts from this blog

renaming files in a directory using python or R -

html - outline-style different in chrome compared to firefox and internet explorer -

ruby on rails - Carrierwave Timeout -