test: Enable sass compiler for bazel integration test (#19357)

This commit is contained in:
Alex Eagle 2017-09-26 09:44:47 -07:00 committed by Victor Berchet
parent 27c6638913
commit 2cf52c1b55
5 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,3 @@
# Workaround https://github.com/bazelbuild/bazel/issues/3645
# Limit Bazel to consuming 3072K of RAM
build --local_resources=3072,2.0,1.0

View File

@ -18,3 +18,13 @@ local_repository(
name = "angular", name = "angular",
path = "node_modules/@angular/bazel", path = "node_modules/@angular/bazel",
) )
git_repository(
name = "io_bazel_rules_sass",
remote = "https://github.com/bazelbuild/rules_sass.git",
tag = "0.0.2",
)
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
sass_repositories()

View File

@ -1,10 +1,15 @@
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
load("@angular//:index.bzl", "ng_module") load("@angular//:index.bzl", "ng_module")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
sass_binary(
name = "hello-world-styles",
src = "hello-world.component.scss",
)
ng_module( ng_module(
name = "hello-world", name = "hello-world",
srcs = glob(["*.ts"]), srcs = glob(["*.ts"]),
tsconfig = "//src:tsconfig.json", tsconfig = "//src:tsconfig.json",
# TODO(alexeagle): re-enable assets = [":hello-world-styles.css"],
# assets = [":styles"],
) )

View File

@ -0,0 +1,5 @@
$example-red: #ff0000;
h1 {
color: $example-red;
}

View File

@ -8,8 +8,7 @@ import {Component, NgModule} from '@angular/core';
<input type="text" [value]="name" (input)="name = $event.target.value"/> <input type="text" [value]="name" (input)="name = $event.target.value"/>
`, `,
// TODO: might be better to point to .scss so this looks valid at design-time // TODO: might be better to point to .scss so this looks valid at design-time
// TODO(alexeagle): re-enable SASS styleUrls: ['./hello-world-styles.css'],
// styleUrls: ['./styles.css']
}) })
export class HelloWorldComponent { export class HelloWorldComponent {
name: string = 'world'; name: string = 'world';