mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Fixed relative require paths
This commit is contained in:
parent
9f3da67cf2
commit
12137402de
13 changed files with 51 additions and 30 deletions
|
@ -10,12 +10,13 @@ const require = function(){
|
|||
const scope = window.scope;
|
||||
|
||||
function getScopeName(module){
|
||||
var scopeName = module.substr(2).replace(/\..+/, "");
|
||||
var scopeName = module.replace(/^\..*\//, "").replace(/\..+/, "");
|
||||
// console.log(scopeName);
|
||||
return scopeName;
|
||||
}
|
||||
|
||||
function require(module){
|
||||
if (module.startsWith("./")){
|
||||
if (module.startsWith(".")){
|
||||
var scopeName = getScopeName(module);
|
||||
return scope[scopeName];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue