From 679f66f1e6e4c564bee369e13f26485108fe436e Mon Sep 17 00:00:00 2001 From: Radium Date: Sat, 29 Feb 2020 13:15:23 +0800 Subject: [PATCH] fix(build): build targets with sass external imports (#60) See #61 --- .bazelrc | 5 ++++- package.json | 8 ++++++-- web/src/BUILD.bazel | 5 ++++- web/src/custom-theme.scss | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.bazelrc b/.bazelrc index 8b5689281..5e793d191 100644 --- a/.bazelrc +++ b/.bazelrc @@ -35,7 +35,10 @@ build --define=angular_ivy_enabled=True common --experimental_allow_incremental_repository_updates # Disable sandbox on Mac OS for performance reason. -build --spawn_strategy=local + +# TODO(https://github.com/MindongLab/yngdieng/issues/61): +# Cannot disable sandbox for build because of SassCompiler not being herematic. +#build --spawn_strategy=local run --spawn_strategy=local test --spawn_strategy=local diff --git a/package.json b/package.json index d5989ef04..dad911f4c 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", - "format": "git-clang-format", - "precommit": "check-clang-format \"yarn format\"" + "format": "git-clang-format" }, "engines": { "node": ">=10.9.0 <13.0.0", @@ -82,5 +81,10 @@ "tslint": "5.15.0", "typescript": "3.6.4", "webpack": "4.41.5" + }, + "husky": { + "hooks": { + "pre-commit": "check-clang-format \"yarn format\"" + } } } diff --git a/web/src/BUILD.bazel b/web/src/BUILD.bazel index 69d9f342b..2a2c5294c 100755 --- a/web/src/BUILD.bazel +++ b/web/src/BUILD.bazel @@ -15,8 +15,11 @@ load("@npm_bazel_terser//:index.bzl", "terser_minified") sass_binary( name = "global_stylesheet", src = "styles.scss", + include_paths = ["external/npm/node_modules"], output_name = "global_stylesheet.css", - deps = [":custom_theme"] + deps = [ + ":custom_theme", + ], ) sass_library( diff --git a/web/src/custom-theme.scss b/web/src/custom-theme.scss index a6ae4c610..ad9c9105d 100644 --- a/web/src/custom-theme.scss +++ b/web/src/custom-theme.scss @@ -1,4 +1,4 @@ -@import 'external/npm/node_modules/@angular/material/theming'; +@import '@angular/material/theming'; // Plus imports for other components in your app. // Include the common styles for Angular Material. We include this here so that you only