-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define */ | |
// This file for the target/public folder | |
define(function() { | |
return 1; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define */ | |
// This file for the target/public folder | |
define(["./a"], function(a) { | |
return a + 1; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export NODE_PATH=`pwd`/target/public:`pwd`/target/public-test \ | |
node target/public-test/test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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