Skip to content

Instantly share code, notes, and snippets.

@DamonOehlman
Created June 25, 2012 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DamonOehlman/2986574 to your computer and use it in GitHub Desktop.
Save DamonOehlman/2986574 to your computer and use it in GitHub Desktop.
Example using interleave to produce a CJS packaged version of a browser based lib
//= github://Wolfy87/Color/color
@DamonOehlman
Copy link
Author

Install interleave:

npm install -g interleave

Compile the file using interleave:

interleave color.js --wrap cjs --output color-common.js

@DamonOehlman
Copy link
Author

Probably worth noting that this isn't really the intended use of Interleave, it's more for building multiple package variants of the same source code (i.e. you use it yourself when writing a library). For example, see the pkg directory in: https://github.com/DamonOehlman/matchme

@liammclennan
Copy link

Translating between module formats makes sense and seems straightforward. Packaging arbitrary scripts seems like it would be hard to tell what to export.

@jed
Copy link

jed commented Jun 25, 2012

will definitely have to learn more about interleave. thanks for the tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment