-
-
Save raine/1313302 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function require(name) { | |
| var exports = {}; | |
| window.modules[name](exports); | |
| return exports; | |
| } |
This file contains hidden or 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
| res.render('modules.ejs', { | |
| locals: { | |
| files: { | |
| helpers: fs.readFileSync('helpers.js', 'utf8') | |
| } | |
| }, | |
| layout: false | |
| }); |
This file contains hidden or 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
| window.modules = {}; | |
| <% for (var file in locals.files) { %> | |
| window.modules['<%- file %>'] = function(exports) { | |
| <%- locals.files[file] %> | |
| <% } %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment