Created
August 24, 2016 15:38
-
-
Save kribblo/29f964d8482b10e21541598a37afbc28 to your computer and use it in GitHub Desktop.
Export base URL of current file, for use in dynamic loading etc. Runs once, at load-time.
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
'use strict'; | |
const scripts = document.getElementsByTagName('script'); | |
const currentScript = scripts[scripts.length - 1]; | |
const baseURL = currentScript.src.substring(0, currentScript.lastIndexOf('/')); | |
module.exports = baseURL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment