Skip to content

Commit 68e7ffa

Browse files
committed
Treat all resolved extensions expect .lua as project members
1 parent 3567987 commit 68e7ffa

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/transpilation/transpilation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class Transpilation {
2020
public outDir: string;
2121
public host: TranspilerHost;
2222

23-
private readonly implicitScriptExtensions = [".ts", ".tsx", ".js", ".jsx"] as const;
2423
protected resolver: Resolver;
2524
public plugins: Plugin[];
2625

@@ -38,7 +37,7 @@ export class Transpilation {
3837
this.plugins = getPlugins(this, extraPlugins);
3938

4039
this.resolver = ResolverFactory.createResolver({
41-
extensions: [".lua", ...this.implicitScriptExtensions],
40+
extensions: [".lua", ".ts", ".tsx", ".js", ".jsx"],
4241
conditionNames: ["lua", `lua:${this.options.luaTarget ?? LuaTarget.Universal}`],
4342
fileSystem: this.host.resolutionFileSystem ?? fs,
4443
useSyncFileSystemCalls: true,
@@ -78,10 +77,7 @@ export class Transpilation {
7877

7978
let module = this.modules.find(m => m.request === resolvedPath);
8079
if (!module) {
81-
if (
82-
this.implicitScriptExtensions.some(extension => resolvedPath.endsWith(extension)) ||
83-
resolvedPath.endsWith(".json")
84-
) {
80+
if (!resolvedPath.endsWith(".lua")) {
8581
throw new Error(`Resolved source file '${resolvedPath}' is not a part of the project.`);
8682
}
8783

0 commit comments

Comments
 (0)