Let's switch from import back to require, to simplify future Node support
This commit is contained in:
parent
28f47a3424
commit
5e2073f3ac
37 changed files with 179 additions and 166 deletions
|
|
@ -514,6 +514,8 @@ HTMLOut.filter = function(req, res, next)
|
|||
} else {
|
||||
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+(['"]).*?\1;)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*export\s+default\s+\S+;)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*var\s+\S+\s+=\s+require\((['"]).*?\1\);)/gm, "// $1");
|
||||
sData = sData.replace(/^([ \t]*(if\s+\(NODE\)\s*|)module\.exports\s+=\s+\S+;)/gm, "// $1");
|
||||
res.set("Content-Type", "application/javascript");
|
||||
res.status(200).send(sData);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue