tbranyen/use.js — Issue #2: Issue when excluding files from build process that use use!
Author: jacobtoye
Created: 2012-02-23 00:16:54+00:00
State: open

When running the require.js optimization tool over a project that is using use.js it assumes that the scripts will be part of the build output file. This is an issue when excluding files from the build.

When running the optimizer, use puts the following in the output file:

```define('use!ajslib', [],function() {return window['ajslib'];});```

If ```ajslib``` was not included in the build file and had not yet been loaded by the browser, a module may execute and try to access ```window.ajslib``` causing an error as it does not exist yet.

My current quick hack is to replace the use.write functions inner code with: ```return;```