This repository was archived by the owner on Aug 7, 2019. It is now read-only.
Add shim to compile optimiser config (with test). #135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the same issue as caolan/jam/#113 with the addition of a test.
The crux of this issue is that if you use shim to define that a package
exportsa variable (e.g. Backbone or in mytest PackageOne) then this shim is needed by require's optimiser to defines the package such that it returns the exported variable.My test includes a module with main.js:
and package.js:
If the shim is not passed to the optimiser then it will define
package-one/mainas:define("package-one/main",function(){})If shim is passed to the optimiser then it will define
package-one/mainas:define("package-one/main",function(e){return function(){var t,n;return t||e.PackageOne}}(this));In both cases
package-oneis defined asdefine("package-one",["package-one/main"],function(e){return e})The result is that without the shim any package that requires
package-oneas a dependency will not get passed PackageOne:In addition I fixed some typos in the other integration tests,