@@ -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