diff --git a/common/src/main/java/me/topchetoeu/j2s/common/Reading.java b/common/src/main/java/me/topchetoeu/j2s/common/Reading.java index c7eedf4..95c8406 100644 --- a/common/src/main/java/me/topchetoeu/j2s/common/Reading.java +++ b/common/src/main/java/me/topchetoeu/j2s/common/Reading.java @@ -79,9 +79,9 @@ public class Reading { if (bytes == null) return null; else return new String(bytes); } - + public static InputStream resourceToStream(String name) { - return Reading.class.getResourceAsStream("/" + name); + return Reading.class.getResourceAsStream("/" + name.replaceAll("//", "/")); } public static String resourceToString(String name) { return streamToString(resourceToStream(name)); diff --git a/lib/src/transpiler/typescript.ts b/lib/src/transpiler/typescript.ts index 02c0f7a..4c85a83 100644 --- a/lib/src/transpiler/typescript.ts +++ b/lib/src/transpiler/typescript.ts @@ -16,10 +16,10 @@ export default function typescript(next: Compiler): Compiler { const settings: CompilerOptions = { target: ScriptTarget.ES5, module: ModuleKind.Preserve, - + allowImportingTsExtensions: true, - verbatimModuleSyntax: true, - + verbatimModuleSyntax: false, + strict: false, skipLibCheck: true, forceConsistentCasingInFileNames: true, @@ -52,7 +52,7 @@ export default function typescript(next: Compiler): Compiler { } }, getScriptVersion: (filename) => String(versions[filename] || 0), - + readFile: () => { throw "no"; }, writeFile: () => { throw "no"; }, }, createDocumentRegistry()); @@ -61,7 +61,7 @@ export default function typescript(next: Compiler): Compiler { service.getEmitOutput("/lib.d.ts"); }); print("Loaded typescript!"); - + return (filename, code, prevMap) => { files["/src.ts"] = ScriptSnapshot.fromString(code); versions["/src.ts"] ??= 0;