Skip to content

Instantly share code, notes, and snippets.

@huntc
Last active January 2, 2016 18:59
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 huntc/8347634 to your computer and use it in GitHub Desktop.
Save huntc/8347634 to your computer and use it in GitHub Desktop.
Shows how NODE_PATH, amdefine and Node can be used together to run things with multiple context paths.
/*global define */
// This file for the target/public folder
define(function() {
return 1;
});
/*global define */
// This file for the target/public folder
define(["./a"], function(a) {
return a + 1;
});
export NODE_PATH=`pwd`/target/public:`pwd`/target/public-test \
node target/public-test/test.js
/*global define, require */
// This file for the target/public-test folder
require("amdefine/intercept");
var b = require("b");
console.log("b: " + b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment