Skip to content

Instantly share code, notes, and snippets.

@phoddie
Last active December 5, 2020 23:29
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 phoddie/714a099644a307ace1ebc3fccbe6f8a9 to your computer and use it in GitHub Desktop.
Save phoddie/714a099644a307ace1ebc3fccbe6f8a9 to your computer and use it in GitHub Desktop.

Example of using manifest paths to include directory of modules. Example in response to Moddable SDK Issue 497.

Organize the files in a directory like this:

  • treeimport
  • app
    • main.js
    • manifest.json
  • lib
    • blue.js
    • red.js

Then build:

cd treeimport/app
mcconfig -d -m

The output is:

red
blue
export default function() {
trace("blue\n");
}
import red from "util/color/red"
import blue from "util/color/blue"
red();
blue();
{
"include": [
"$(MODDABLE)/examples/manifest_base.json"
],
"modules": {
"*": [
"./main"
],
"util/color/*": "../lib/color/*"
}
}
export default function() {
trace("red\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment