We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In mocha.js they using a CommonJS require to make mocha runable in browser, it is a lite version of brequire.
Compiled single JS may looks like this:
;(function(){ // ** AMD wrapper here? ** // ** jsprelude stuff here ** // CommonJS require() function require(p){ var path = require.resolve(p) , mod = require.modules[path]; if (!mod) throw new Error('failed to require "' + p + '"'); if (!mod.exports) { mod.exports = {}; mod.call(mod.exports, mod, mod.exports, require.relative(path)); } return mod.exports; } require.modules = {}; require.resolve = function (path){ var orig = path , reg = path + '.js' , index = path + '/index.js'; return require.modules[reg] && reg || require.modules[index] && index || orig; }; require.register = function (path, fn){ require.modules[path] = fn; }; require.relative = function (parent) { return function(p){ if ('.' != p.charAt(0)) return require(p); var path = parent.split('/') , segs = p.split('/'); path.pop(); for (var i = 0; i < segs.length; i++) { var seg = segs[i]; if ('..' == seg) path.pop(); else if ('.' != seg) path.push(seg); } return require(path.join('/')); }; };
Then gorillascript compiled with options.bare on then wrapped in this form:
options.bare
require.register("path/to/file.gs", function(module, exports, require){ // [gorillascript compiled] }); // module: path/to/file.gs
The text was updated successfully, but these errors were encountered:
I've create a new branch brequire in my fork, you can use this to try it out:
brequire
gorilla --commonjs -c -o all.js **/*.gs
Sorry, something went wrong.
No branches or pull requests
In mocha.js they using a CommonJS require to make mocha runable in browser, it is a lite version of brequire.
Compiled single JS may looks like this:
Then gorillascript compiled with
options.bare
on then wrapped in this form:The text was updated successfully, but these errors were encountered: