Add css-browser-selector to BAZEL build file in data/web/js/vendor

This commit is contained in:
Henrik Giesel 2020-12-31 16:41:01 +01:00
parent bfd9c93e61
commit ebb8171021
2 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,7 @@
load("//ts:jquery.bzl", "copy_jquery") load("//ts:jquery.bzl", "copy_jquery")
load("//ts:jquery-ui.bzl", "copy_jquery_ui") load("//ts:jquery-ui.bzl", "copy_jquery_ui")
load("//ts:protobufjs.bzl", "copy_protobufjs") load("//ts:protobufjs.bzl", "copy_protobufjs")
load("//ts:css-browser-selector.bzl", "copy_css_browser_selector")
copy_jquery( copy_jquery(
name = "jquery", name = "jquery",
@ -17,11 +18,17 @@ copy_protobufjs(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
copy_css_browser_selector(
name = "css-browser-selector",
visibility = ["//visibility:public"],
)
files = [ files = [
"jquery", "jquery",
"jquery-ui", "jquery-ui",
"protobufjs", "protobufjs",
"css-browser-selector",
] ]
directories = [ directories = [

View File

@ -3,14 +3,14 @@ load("//ts:copy.bzl", "copy_files")
"Rule to copy css-browser-selector subset from node_modules to vendor folder." "Rule to copy css-browser-selector subset from node_modules to vendor folder."
_include = [ _include = [
"css-browser-selector.min.js", "css_browser_selector.min.js",
] ]
_unwanted_prefix = "external/npm/node_modules/css-browser-selector/" _unwanted_prefix = "external/npm/node_modules/css-browser-selector/"
def _copy_browsersel(ctx): def _copy_css_browser_selector_impl(ctx):
wanted = [] wanted = []
for f in ctx.attr.browsersel.files.to_list(): for f in ctx.attr.css_browser_selector.files.to_list():
path = f.path path = f.path
want = True want = True
@ -21,9 +21,9 @@ def _copy_browsersel(ctx):
return copy_files(ctx, wanted) return copy_files(ctx, wanted)
copy_browsersel = rule( copy_css_browser_selector = rule(
implementation = _copy_browsersel_impl, implementation = _copy_css_browser_selector_impl,
attrs = { attrs = {
"browsersel": attr.label(default = "@npm//css-browser-selector:css_browser-selector__files"), "css_browser_selector": attr.label(default = "@npm//css-browser-selector:css-browser-selector__files"),
}, },
) )