Skip to content

Commit 59b5163

Browse files
committed
build: build material-examples with bazel
1 parent 28fb3ab commit 59b5163

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

src/bazel-tsconfig-build.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@
2424
"lib": ["es2015", "dom"],
2525
"skipLibCheck": true,
2626
"types": ["tslib"]
27+
},
28+
"bazelOptions": {
29+
// Note: We can remove this once we fully switched away from Gulp. Currently we still set
30+
// some options here just in favor of the standard tsconfig's which extending this one.
31+
"suppressTsconfigOverrideWarnings": true
2732
}
2833
}

src/material-examples/BUILD.bazel

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package(default_visibility=["//visibility:public"])
2+
3+
load("@angular//:index.bzl", "ng_package")
4+
load("//:packages.bzl", "CDK_TARGETS", "MATERIAL_TARGETS", "ROLLUP_GLOBALS")
5+
load("//tools:defaults.bzl", "ng_module")
6+
7+
ng_module(
8+
name = "examples",
9+
srcs = glob(["**/*.ts"]),
10+
module_name = "@angular/material-examples",
11+
assets = glob(["**/*.html", "**/*.css"]),
12+
deps = [
13+
"@angular//packages/common",
14+
"@angular//packages/core",
15+
"@angular//packages/forms",
16+
"@npm//moment",
17+
"//src/material-moment-adapter",
18+
] + CDK_TARGETS + MATERIAL_TARGETS,
19+
# Specify the tsconfig that is also used by Gulp. We need to explicitly use this tsconfig
20+
# because in order to import Moment with TypeScript, some specific options need to be set.
21+
tsconfig = ":tsconfig-build.json",
22+
)
23+
24+
ng_package(
25+
name = "npm_package",
26+
srcs = ["package.json"],
27+
entry_point = "src/material-examples/public_api.js",
28+
globals = ROLLUP_GLOBALS,
29+
deps = [":examples"],
30+
# TODO(devversion): re-enable once we have set up the proper compiler for the ng_package
31+
tags = ["manual"],
32+
)

src/material-examples/tsconfig-tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// Unset options inherited from tsconfig-build
1919
"annotateForClosureCompiler": false,
2020
"flatModuleOutFile": null,
21-
"flatModuleId": null,
21+
"flatModuleId": null
2222
},
2323
"include": [
2424
"**/*.spec.ts",

0 commit comments

Comments
 (0)