You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throughout the code base of rules_esbuild there are multiple places which make it impractical if not impossible to use a typescript entry point and have esbuild resolve depedencies using a tsconfig.json file.
To start this is this line which explictly removes the ability to pass esbuild a tsconfig file:
This is problematic since it leaves no way for targets to specify runtime dependencies they want to make available to esbuild during bundling. A common use case for this is to have a css import in a .ts or .js file import ./index.css. One would make index.css a data dependency of their ts_project or js_library target, expecting that this would make it so that the esbuild bundler would make the file available during bundling. However, this is not the case.
The only way to include non .js files is to specify the entire transitive closure of targets you need available within the srcs attribute. This is not sufficient for builds with many transitive dependencies. Each transitive dep should be able to declare what it needs to have available during bundling.
The text was updated successfully, but these errors were encountered:
@mrmeku if the line you pointed out is deleted can you use js_library for the full dep tree?
Then for the type-checking ts_project(declaration_only=True,testonly=True) + build_test. I'm not 100% sure if that ts_project could then depend on the js_library (leaf nodes of the js_library dep tree) or if it would have to depend on the other ts_projects (parallel dep tree).
Throughout the code base of rules_esbuild there are multiple places which make it impractical if not impossible to use a typescript entry point and have esbuild resolve depedencies using a tsconfig.json file.
To start this is this line which explictly removes the ability to pass esbuild a tsconfig file:
rules_esbuild/esbuild/private/launcher.js
Line 60 in f3def54
Secondly, when gathering transitive input sources, only files from js_providers are considered and the rest are thrown out: https://github.com/aspect-build/rules_esbuild/blob/main/esbuild/private/esbuild.bzl#L301
This is problematic since it leaves no way for targets to specify runtime dependencies they want to make available to esbuild during bundling. A common use case for this is to have a css import in a .ts or .js file
import ./index.css
. One would makeindex.css
a data dependency of theirts_project
orjs_library
target, expecting that this would make it so that the esbuild bundler would make the file available during bundling. However, this is not the case.The only way to include non .js files is to specify the entire transitive closure of targets you need available within the
srcs
attribute. This is not sufficient for builds with many transitive dependencies. Each transitive dep should be able to declare what it needs to have available during bundling.The text was updated successfully, but these errors were encountered: