diff --git a/packages/bazel/src/schematics/bazel-workspace/files/src/BUILD.bazel.template b/packages/bazel/src/schematics/bazel-workspace/files/src/BUILD.bazel.template index 2bd360ac33..172bfedb04 100644 --- a/packages/bazel/src/schematics/bazel-workspace/files/src/BUILD.bazel.template +++ b/packages/bazel/src/schematics/bazel-workspace/files/src/BUILD.bazel.template @@ -5,16 +5,12 @@ load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") 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_typescript//:defs.bzl", "ts_devserver", "ts_library") -<% if (sass) { %>load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") +<% if (sass) { %>load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary") -[ -sass_binary( - name = "style_" + x, - src = x, - deps = [], +multi_sass_binary( + name = "styles", + srcs = glob(["**/*.scss"]), ) -for x in glob(["**/*.scss"]) -] <% } %> ng_module( name = "src", @@ -30,7 +26,7 @@ ng_module( assets = glob([ "**/*.css", "**/*.html", - ])<% if (sass) { %> + [":style_" + x for x in glob(["**/*.scss"])]<% } %>, + ])<% if (sass) { %> + [":styles"]<% } %>, deps = [ "@angular//packages/core", "@angular//packages/platform-browser",<% if (routing) { %> diff --git a/packages/bazel/src/schematics/bazel-workspace/index.ts b/packages/bazel/src/schematics/bazel-workspace/index.ts index ab3b676daa..5eb804bd9b 100644 --- a/packages/bazel/src/schematics/bazel-workspace/index.ts +++ b/packages/bazel/src/schematics/bazel-workspace/index.ts @@ -95,7 +95,7 @@ export default function(options: BazelWorkspaceOptions): Rule { 'ANGULAR_VERSION': existingVersions.Angular || clean(latestVersions.Angular), 'RXJS_VERSION': existingVersions.RxJs || clean(latestVersions.RxJs), // TODO(kyliau): Consider moving this to latest-versions.ts - 'RULES_SASS_VERSION': '1.15.1', + 'RULES_SASS_VERSION': '1.17.0', }; return mergeWith(apply(url('./files'), [ diff --git a/packages/bazel/src/schematics/bazel-workspace/index_spec.ts b/packages/bazel/src/schematics/bazel-workspace/index_spec.ts index 056f1c6ed5..085fb7a952 100644 --- a/packages/bazel/src/schematics/bazel-workspace/index_spec.ts +++ b/packages/bazel/src/schematics/bazel-workspace/index_spec.ts @@ -100,9 +100,9 @@ describe('Bazel-workspace Schematic', () => { 'load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")'); }); - it('should add sass_binary rules in src/BUILD', () => { + it('should add multi_sass_binary rule in src/BUILD', () => { const content = host.readContent('/src/BUILD.bazel'); - expect(content).toContain('load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")'); + expect(content).toContain('load("@io_bazel_rules_sass//:defs.bzl", "multi_sass_binary")'); expect(content).toContain('glob(["**/*.scss"])'); }); });