You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First of all, sorry for raising an issue for this question.
I want to achieve the RequireJS equivalent of
define(['text!/templates/myTemplate','underscore'], function (templateFile, _) {
// templateFile contains the content of (/template/myTemplate)
...});
In this case, /templates/myTemplate is a url serving the compiled template file.
So I need Webpack to generate a bundle with the underscore dependency but also, on runtime, to load the result of /templates/myTemplate (and pass it through an html loader I guess).
No this can't be required with webpack. webpack only cares for compile-time dependencies. You need to use XHR or a lib like async.js to load these files on runtime.
Hello,
First of all, sorry for raising an issue for this question.
I want to achieve the RequireJS equivalent of
In this case, /templates/myTemplate is a url serving the compiled template file.
So I need Webpack to generate a bundle with the underscore dependency but also, on runtime, to load the result of /templates/myTemplate (and pass it through an html loader I guess).
How can this be achieved using Webpack?
This is the behaviour on RequireJS link
Thank you
The text was updated successfully, but these errors were encountered: