Last active
February 11, 2024 23:18
-
-
Save jrburke/7896791 to your computer and use it in GitHub Desktop.
Manual main switching
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
// For any third party dependencies, like jQuery, place them in the lib folder. | |
// Configure loading modules from the lib directory, | |
// except for 'app' ones, which are in a sibling | |
// directory. | |
requirejs.config({ | |
baseUrl: 'lib', | |
paths: { | |
app: '../app' | |
} | |
}); | |
var main = 'app/main', | |
scriptNode = document.querySelector('[data-postmain]'); | |
if (scriptNode) { | |
main = scriptNode.dataSet.postmain; | |
} | |
requirejs([main]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment