2021-04-19 12:37:56 +02:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
|
|
|
|
|
|
PKG_BASE_NAME = "kbn-babel-preset"
|
|
|
|
PKG_REQUIRE_NAME = "@kbn/babel-preset"
|
|
|
|
|
|
|
|
SOURCE_FILES = glob([
|
|
|
|
"common_babel_parser_options.js",
|
|
|
|
"common_preset.js",
|
|
|
|
"istanbul_preset.js",
|
|
|
|
"node_preset.js",
|
|
|
|
"webpack_preset.js",
|
|
|
|
])
|
|
|
|
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "srcs",
|
|
|
|
srcs = SRCS,
|
|
|
|
)
|
|
|
|
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
|
|
"package.json",
|
|
|
|
"README.md",
|
|
|
|
]
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
"@npm//@babel/plugin-proposal-class-properties",
|
|
|
|
"@npm//@babel/plugin-proposal-export-namespace-from",
|
|
|
|
"@npm//@babel/plugin-proposal-nullish-coalescing-operator",
|
|
|
|
"@npm//@babel/plugin-proposal-optional-chaining",
|
|
|
|
"@npm//@babel/plugin-proposal-private-methods",
|
|
|
|
"@npm//@babel/preset-env",
|
|
|
|
"@npm//@babel/preset-react",
|
|
|
|
"@npm//@babel/preset-typescript",
|
|
|
|
"@npm//babel-plugin-add-module-exports",
|
|
|
|
"@npm//babel-plugin-styled-components",
|
2021-05-27 19:55:28 +02:00
|
|
|
"@npm//babel-plugin-transform-react-remove-prop-types",
|
2021-04-19 12:37:56 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
js_library(
|
|
|
|
name = PKG_BASE_NAME,
|
2021-04-23 18:48:48 +02:00
|
|
|
srcs = NPM_MODULE_EXTRA_FILES + [
|
2021-04-19 12:37:56 +02:00
|
|
|
":srcs",
|
|
|
|
],
|
|
|
|
deps = DEPS,
|
|
|
|
package_name = PKG_REQUIRE_NAME,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_npm(
|
|
|
|
name = "npm_module",
|
|
|
|
deps = [
|
|
|
|
":%s" % PKG_BASE_NAME,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "build",
|
|
|
|
srcs = [
|
|
|
|
":npm_module",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|