@@ -176,12 +176,13 @@ See https://github.com/aspect-build/rules_ts/issues/361 for more details.
176
176
outputs .append (ctx .outputs .buildinfo_out )
177
177
178
178
output_sources = js_outs + map_outs + assets_outs + ctx .files .pretranspiled_js
179
+ output_types = typings_outs + typing_maps_outs + ctx .files .pretranspiled_dts
179
180
180
181
# Add JS inputs that collide with outputs (see #250).
181
182
#
182
183
# Unfortunately this duplicates logic in ts_lib._to_js_out_paths:
183
184
# files collide iff the following conditions are met:
184
- # - They are JS files (ext in [js, json])
185
+ # - They are files not renamed when transpiled (ext in [.d.ts, js, json])
185
186
# - out_dir == root_dir
186
187
#
187
188
# The duplication is hard to avoid, since out_paths works on path strings
@@ -190,15 +191,13 @@ See https://github.com/aspect-build/rules_ts/issues/361 for more details.
190
191
for s in srcs_inputs :
191
192
if _lib .is_js_src (s .path , ctx .attr .allow_js , ctx .attr .resolve_json_module ):
192
193
output_sources .append (s )
193
-
194
- typings_srcs = [ s for s in srcs_inputs if _lib . is_typings_src ( s . path )]
194
+ if _lib . is_typings_src ( s . path ):
195
+ output_types . append ( s )
195
196
196
197
# Make sure the user has acknowledged that transpiling is slow
197
198
if len (outputs ) > 0 and ctx .attr .transpile == - 1 and not ctx .attr .emit_declaration_only and not options .default_to_tsc_transpiler :
198
199
fail (transpiler_selection_required )
199
200
200
- output_types = typings_outs + typing_maps_outs + typings_srcs + ctx .files .pretranspiled_dts
201
-
202
201
# What tsc will be emitting
203
202
use_tsc_for_js = len (js_outs ) > 0
204
203
use_tsc_for_dts = len (typings_outs ) > 0
0 commit comments