Skip to content

Commit

Permalink
fix(bazel): Load global stylesheet in dev and prod (#30879)
Browse files Browse the repository at this point in the history
Global stylesheet should be injected as a <link> tag in index.html for
both dev and prod app.

PR Close #30879
  • Loading branch information
kyliau authored and mhevery committed Jun 6, 2019
1 parent 152ea36 commit 5a7bcd1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/bazel/src/builders/files/src/BUILD.bazel.template
Expand Up @@ -5,11 +5,20 @@ load("@npm_bazel_karma//:index.bzl", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle", "history_server") load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle", "history_server")
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library") load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary") load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary", "sass_binary")

sass_binary(
name = "global_stylesheet",
src = glob(["styles.css", "styles.scss"])[0],
output_name = "global_stylesheet.css",
)


multi_sass_binary( multi_sass_binary(
name = "styles", name = "styles",
srcs = glob(["**/*.scss"]), srcs = glob(
include = ["**/*.scss"],
exclude = ["styles.scss"],
),
) )


ng_module( ng_module(
Expand Down Expand Up @@ -52,6 +61,7 @@ web_package(
# do not sort # do not sort
"@npm//node_modules/zone.js:dist/zone.min.js", "@npm//node_modules/zone.js:dist/zone.min.js",
":bundle.min.js", ":bundle.min.js",
":global_stylesheet",
], ],
data = [ data = [
"favicon.ico", "favicon.ico",
Expand Down Expand Up @@ -85,6 +95,7 @@ ts_devserver(
], ],
static_files = [ static_files = [
"@npm//node_modules/zone.js:dist/zone.min.js", "@npm//node_modules/zone.js:dist/zone.min.js",
":global_stylesheet",
], ],
data = [ data = [
"favicon.ico", "favicon.ico",
Expand Down

0 comments on commit 5a7bcd1

Please sign in to comment.