Skip to content

Commit 41cc084

Browse files
author
Chuck Dumont
authored
Update README.md
1 parent e019405 commit 41cc084

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ plugins: [
2828

2929
Because the loader config is used to resolve module paths both at build time, and on the client, you may need to conditionally specify some properties, such as `baseUrl`, depending on whether the current environment is node or a browser. This may be necessary if you need `require.toUrl()` to return a valid URLs on the client or if you want to support non-packed versions of the app (e.g. for development). See [js/loaderConfig.js](https://github.com/OpenNTF/dojo-webpack-plugin-sample/blob/master/js/loaderConfig.js) in the sample project for an example of a Dojo loader config that works both with and without webpack.
3030

31-
The loader config may be specified as an object, or as a string which represents the name of a CommonJS module that exports the config. If specified as an object, then the config expressions are evaluated at build time and the object is mixed with the `window.dojoConfig` property defined by the client.
31+
The loader config may be specified as an object, or as a string which represents the name of a CommonJS module that exports the config. If specified as an object, then the config expressions are evaluated at build time and the config is exported to the client as a JSON object that is mixed with the `window.dojoConfig` property at application load time.
3232

33-
If the config is specified as a module name, then the config module will be evaluated both at build-time (for the purpose of resolving modules for webpack), and then again at application run-time when the config module is loaded on the client. In addition, instead of exporting the config, the module may export a function that returns the config. The function will be called with the value of the [environment](#environment) option. This mechanism allows for multi-compiler runs that use different configs.
33+
If the config is specified as a module name, then the config module will be evaluated both at build-time (for the purpose of resolving modules for webpack), and then again at application run-time when the config module is loaded on the client. Note that if you want webpack to process the config module (i.e. perform build time variable substitution, etc.) then you must specify the config as a module name.
34+
35+
In addition, instead of exporting the config, the module may export a function that returns the config. The function will be called with the value of the [environment](#environment) option. This mechanism allows for multi-compiler runs that use different configs.
3436

3537
# Dojo loader extensions
3638

0 commit comments

Comments
 (0)