1
0

helpers.js 724 B

1234567891011121314151617181920212223242526
  1. function nodeWrapper() {
  2. return {
  3. start: "(function(define, require){\n" +
  4. "define(function (requirejs) {\n" +
  5. "var module = void 0; // Bad UMDs workaround\n" +
  6. "requirejs.resolve = require.resolve;\n" +
  7. "require = requirejs;\n",
  8. end: "});\n" +
  9. "}((" +
  10. require("@ambers/amdefine") +
  11. "(module)), require));"
  12. };
  13. }
  14. var SHEBANG = "#!/usr/bin/env node",
  15. WRAPPER = nodeWrapper(),
  16. WRAPPER_WITH_SHEBANG = nodeWrapper();
  17. WRAPPER_WITH_SHEBANG.start = SHEBANG + "\n" + WRAPPER_WITH_SHEBANG.start;
  18. module.exports = {
  19. libPath: __dirname,
  20. nodeShebang: SHEBANG,
  21. nodeWrapper: WRAPPER,
  22. nodeWrapperWithShebang: WRAPPER_WITH_SHEBANG
  23. };