Skip to content

Commit

Permalink
feat(stylus): output sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Jul 24, 2019
1 parent 3987070 commit dac014a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/stylus/src/index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit dac014a

Please sign in to comment.