configuration - RequireJS Text Plugin installed with Bower -
how should using requirejs-text
installed via bower? supposed put in baseurl
wonder if use components/requirejs-text/
? whats best practice?
define path plugin in config:
requirejs.config({ paths: { "text" : "components/requirejs-text/text" } },
and use in module documented on https://github.com/requirejs/text:
require(["some/module", "text!some/module.html", "text!some/module.css"], function(module, html, css) { //the html variable text //of some/module.html file //the css variable text //of some/module.css file. } );
you can use technically use plugin without path definition in requirejs.config, propbably not best practice:
require(["your_path_to_the_plugin_from_baseurl/without_js_at_the_end!some/textfile"], function(yourtextfile) { } );
Comments
Post a Comment