blob: 733d8d93ef5cce94ab7ba3825a28992b2fab6995 [file]
load("@aspect_rules_js//js:defs.bzl", "js_library", "js_test")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//webpack_cli:webpack-cli/package_json.bzl", "bin")
npm_link_all_packages()
js_library(
name = "lib",
srcs = [
"index.css.ts",
"index.js",
"package.json",
],
deps = [
":node_modules/@vanilla-extract/css",
":node_modules/mathjs",
],
)
js_library(
name = "webpack-config",
srcs = ["webpack.config.js"],
deps = [
":node_modules/@vanilla-extract/webpack-plugin",
":node_modules/css-loader",
":node_modules/mini-css-extract-plugin",
],
)
bin.webpack_cli(
name = "bundle",
srcs = [":lib"],
outs = ["dist/main.js"],
chdir = package_name(),
data = [":webpack-config"],
fixed_args = [
"--config",
"$$RUNFILES_DIR/$(rlocationpath :webpack-config)",
],
log_level = "debug",
)
js_test(
name = "test",
entry_point = "dist/main.js",
)