blob: 2a834eebd485ef185b756d61da7ec1a072e73b80 [file]
load("@npm//http-server:index.bzl", "http_server")
load("@npm//sass:index.bzl", "sass")
load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli")
load("@npm_bazel_typescript//:index.bzl", "ts_project")
sass(
name = "styles",
outs = ["styles.css"],
args = [
"$(execpath styles.scss)",
"$(execpath styles.css)",
],
data = ["styles.scss"],
)
ts_project(
deps = [
"@npm//@types",
"@npm//csstype",
],
)
webpack(
name = "bundle",
outs = ["app.bundle.js"],
args = [
"$(execpath index.js)",
"--config",
"$(execpath webpack.config.js)",
"-o",
"$@",
],
data = [
"index.js",
"styles.css",
"webpack.config.js",
"@npm//:node_modules",
],
)
# Note, on Windows you need `--enable_runfiles`
http_server(
name = "server",
data = [
"app.bundle.js",
"index.html",
],
templated_args = ["."],
)