@@ -132,17 +132,21 @@ type Runner =
132132 else
133133 Ok fsprojPath
134134
135- // TODO: Remove this check when typed arrays are compatible with typescript
136135 |> Result.bind ( fun projFile ->
137136 let language = argLanguage args
138137 let typedArrays = tryFlag " --typedArrays" args |> Option.defaultValue true
139- if language = TypeScript && typedArrays then
138+ let outDir = argValueMulti [ " -o" ; " --outDir" ] args |> Option.map normalizeAbsolutePath
139+ let outDirLast = outDir |> Option.bind ( fun outDir -> outDir.TrimEnd( '/' ) .Split( '/' ) |> Array.tryLast) |> Option.defaultValue " "
140+ if outDirLast = " .fable" then
141+ Error( " .fable is a reserved directory, please use another output directory" )
142+ // TODO: Remove this check when typed arrays are compatible with typescript
143+ elif language = TypeScript && typedArrays then
140144 Error( " Typescript output is currently not compatible with typed arrays, pass: --typedArrays false" )
141145 else
142- Ok( projFile, language, typedArrays)
146+ Ok( projFile, outDir , language, typedArrays)
143147 )
144148
145- |> Result.bind ( fun ( projFile , language , typedArrays ) ->
149+ |> Result.bind ( fun ( projFile , outDir , language , typedArrays ) ->
146150 let verbosity =
147151 if flagEnabled " --verbose" args then
148152 Log.makeVerbose()
@@ -182,7 +186,7 @@ type Runner =
182186 FableLibraryPath = argValue " --fableLib" args
183187 RootDir = rootDir
184188 Configuration = configuration
185- OutDir = argValueMulti [ " -o " ; " -- outDir" ] args |> Option.map normalizeAbsolutePath
189+ OutDir = outDir
186190 SourceMaps = flagEnabled " -s" args || flagEnabled " --sourceMaps" args
187191 SourceMapsRoot = argValue " --sourceMapsRoot" args
188192 NoRestore = flagEnabled " --noRestore" args
0 commit comments