Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added shim config to compile command #113

Open
wants to merge 1 commit into from

2 participants

@pfraze

Issue: the compile command currently doesn't include shim config the project is using, so optimized output breaks

Solution: include shim config from jam/require.config.js in the optimize call

@caolan
Owner

Is this after you've edited the values in require.config.js? This file is generated by Jam and changes to it will not be reflected in the optimized builds. Currently, we're suggesting people manage their requirejs config in a separate file.

@pfraze

We didn't mod require.config.js. We're trying to use jam's generated shim in the compiled output -- currently, it only gets used in the uncompiled output.

RE: our use-case -- Without this change, our compiled output doesn't properly wait for Backbone to be defined before executing (no shim). I don't fully recall the solutions we tried, but, at the time of this pull request, I couldn't find an alternative way of getting the shims into the compiled output. Was I wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2012
  1. added shim config to compile command

    Paul Frazee authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/commands/compile.js
View
3  lib/commands/compile.js
@@ -122,7 +122,8 @@ exports.run = function (settings, _args, commands) {
wrap: a.options.wrap,
optimize: 'uglify',
include: includes,
- out: a.options.outfile
+ out: a.options.outfile,
+ shim: require(configfile).shim
};
requirejs.optimize(config, function (build_response) {
logger.end(a.options.outfile);
Something went wrong with that request. Please try again.