From dac014a1468e874830fa56e0190ffe4648d5f898 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 11 Jul 2019 15:39:16 -0700 Subject: [PATCH] feat(stylus): output sourcemap --- packages/stylus/src/index.bzl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/stylus/src/index.bzl b/packages/stylus/src/index.bzl index 4f96bef071..d1a3846e65 100644 --- a/packages/stylus/src/index.bzl +++ b/packages/stylus/src/index.bzl @@ -6,19 +6,22 @@ def _stylus_binary(ctx): src = ctx.file.src # We want foo.styl to produce foo.css - output = ctx.actions.declare_file(src.basename[:-5] + ".css") + output_name = src.basename[:-5] + ".css" + css_output = ctx.actions.declare_file(output_name) + map_output = ctx.actions.declare_file(output_name + ".map") ctx.actions.run( - outputs = [output], + outputs = [css_output, map_output], inputs = [src] + ctx.files.deps, executable = ctx.executable._compiler, arguments = [ + "--sourcemap", "--out", ctx.bin_dir.path + "/" + ctx.label.package, src.path, ], ) return [ - DefaultInfo(files = depset([output])), + DefaultInfo(files = depset([css_output, map_output])), ] stylus_binary = rule(