-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples for dojo/text or dojo/nls #10
Comments
We also had some problems with
After this every module that tries to use |
That seems to work, thanks! Also, I guess We have a module that uses the dojo loader lifecycle to load multiple resources at once.. see below: and the module definition: define(['dojo/_base/array', 'dojo/_base/lang', 'wtl/classes/locale'], function (array, lang, locale) {
return {
load: function (id, require, load) {
var names = id.split(','),
results = {},
cnt = 0;
array.forEach(names, function (name) {;
require(['dojo/text!/api/resource/' + locale.getLocale() + '/' + name], function (text) {
lang.mixin(results, JSON.parse(text));
if (++cnt === names.length) {//we're all done!
load(results);
}
});
});
}
};
}) I've been working on a solution using commonjs (synchronous) but need to work out all the details still... |
What if I define module like this: Can I use the same solution.
and still have the same issue. |
should I more 'dojo/text!./templates/databar.html' |
yea, I noticed that too. Dojo/text does more than just load raw strings. It also looks like it parses xml and potentially other formats. When you alias to raw-loader, dojo/text doesn't parse the data. I'll have to look at that tomorrow when I have a little time, maybe I can help sort this out. |
Webpack uses the '!' symbol in require statements as a way to use loaders in-line. I had to use the normalModuleReplacementPlugin in my webpack config to get around some of the oddities of dojo. I've put up my working demo here dojo-webpack-loader-additional-examples. I also put together resx-webpack-loader that transforms resx files into javascript objects. |
I seem to be having trouble with dojo-webpack-loader when using dojo/text. I've looked through the example js files and can't find one that directly uses dojo/text or dojo/nls..
It appears as if webpack uses exclamation marks for loaders, as you alluded to in the readme. I've been able to sort of get around this if I use an alias, but I was hopeful that the dojo-webpack-loader would be able to get around these issues with webpack.
Thoughts?
The text was updated successfully, but these errors were encountered: