anki/ts/jquery.bzl

28 lines
556 B
Python
Raw Normal View History

load("//ts:copy.bzl", "copy_select_files")
"Rule to copy jquery subset from node_modules to vendor folder."
_include = [
"dist/jquery.min.js"
]
2021-01-01 14:39:15 +01:00
_base = "external/npm/node_modules/jquery/"
_unwanted_prefix = "dist/"
def _copy_jquery_impl(ctx):
return copy_select_files(
ctx,
ctx.attr.jquery.files,
_include,
[],
2021-01-01 14:39:15 +01:00
_base,
_unwanted_prefix,
)
copy_jquery = rule(
implementation = _copy_jquery_impl,
attrs = {
"jquery": attr.label(default = "@npm//jquery:jquery__files"),
},
)