@@ -28,6 +28,9 @@ def _esbuild_impl(ctx):
2828 elif hasattr (dep , "files" ):
2929 deps_depsets .append (dep .files )
3030
31+ if DefaultInfo in dep :
32+ deps_depsets .append (dep [DefaultInfo ].data_runfiles .files )
33+
3134 if NpmPackageInfo in dep :
3235 deps_depsets .append (dep [NpmPackageInfo ].sources )
3336 npm_workspaces .append (dep [NpmPackageInfo ].workspace )
@@ -100,6 +103,9 @@ def _esbuild_impl(ctx):
100103 fail ("output_map must be specified if sourcemap is not set to 'inline'" )
101104 outputs .append (js_out_map )
102105
106+ if ctx .outputs .output_css :
107+ outputs .append (ctx .outputs .output_css )
108+
103109 if ctx .attr .format :
104110 args .add_joined (["--format" , ctx .attr .format ], join_with = "=" )
105111
@@ -219,6 +225,14 @@ See https://esbuild.github.io/api/#splitting for more details
219225 mandatory = False ,
220226 doc = "Name of the output source map when bundling" ,
221227 ),
228+ "output_css" : attr .output (
229+ mandatory = False ,
230+ doc = """Declare a .css file will be output next to output bundle.
231+
232+ If your JS code contains import statements that import .css files, esbuild will place the
233+ content in a file next to the main output file, which you'll need to declare. If your output
234+ file is named 'foo.js', you should set this to 'foo.css'.""" ,
235+ ),
222236 "platform" : attr .string (
223237 default = "browser" ,
224238 values = ["node" , "browser" , "neutral" , "" ],
0 commit comments