Last active
June 23, 2020 22:50
-
-
Save donpark/5c633bcd0ead47d81782c7030d3741ae to your computer and use it in GitHub Desktop.
scriptBaseUrl
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
// This needs to run when script loads. | |
const scriptUrl = new URL(document.currentScript.src, document.baseURI).toString(); | |
const scriptBaseUrl = scriptUrl.substr(0, scriptUrl.lastIndexOf('/')); | |
// To build URL relative to script file. | |
const wasm = `${scriptBaseUrl}/wasm/my.wasm` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment