mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 10:11:50 +08:00
94 lines
2.3 KiB
Python
94 lines
2.3 KiB
Python
# Copyright Google Inc. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by an MIT-style license that can be
|
|
# found in the LICENSE file at https://angular.io/license
|
|
|
|
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
|
|
load("//tools:defaults.bzl", "ts_library")
|
|
|
|
# @external_begin
|
|
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
|
|
# @external_end
|
|
|
|
licenses(["notice"]) # MIT
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
ts_library(
|
|
name = "build_optimizer",
|
|
srcs = glob(
|
|
include = ["src/**/*.ts"],
|
|
exclude = [
|
|
# TODO(@filipesilva): shouldn't need to exclude the cli files but can't exclude them
|
|
# from jasmine_node_test.
|
|
"src/**/cli.ts",
|
|
"src/**/*_spec.ts",
|
|
"src/**/*_benchmark.ts",
|
|
],
|
|
),
|
|
data = [
|
|
"package.json",
|
|
"webpack-loader/package.json",
|
|
],
|
|
module_name = "@angular-devkit/build-optimizer",
|
|
module_root = "src/index.d.ts",
|
|
deps = [
|
|
"//packages/angular_devkit/build_optimizer/third_party/github.com/Microsoft/TypeScript",
|
|
"@npm//@types/node",
|
|
"@npm//@types/webpack",
|
|
"@npm//@types/webpack-sources",
|
|
"@npm//source-map",
|
|
"@npm//tslib",
|
|
],
|
|
)
|
|
|
|
ts_library(
|
|
name = "build_optimizer_test_lib",
|
|
testonly = True,
|
|
srcs = glob(["src/**/*_spec.ts"]),
|
|
# @external_begin
|
|
deps = [
|
|
":build_optimizer",
|
|
"//packages/angular_devkit/build_optimizer/third_party/github.com/Microsoft/TypeScript",
|
|
"//packages/angular_devkit/core",
|
|
"@npm//source-map",
|
|
],
|
|
# @external_end
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "build_optimizer_test",
|
|
srcs = [":build_optimizer_test_lib"],
|
|
deps = [
|
|
"@npm//jasmine",
|
|
"@npm//source-map",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "no_typescript_runtime_dep_test",
|
|
srcs = ["no_typescript_runtime_dep_spec.js"],
|
|
deps = [
|
|
":build_optimizer",
|
|
"@npm//jasmine",
|
|
],
|
|
)
|
|
|
|
# @external_begin
|
|
pkg_npm(
|
|
name = "npm_package",
|
|
deps = [
|
|
":build_optimizer",
|
|
],
|
|
)
|
|
|
|
pkg_tar(
|
|
name = "npm_package_archive",
|
|
srcs = [":npm_package"],
|
|
extension = "tar.gz",
|
|
strip_prefix = "./npm_package",
|
|
tags = ["manual"],
|
|
)
|
|
# @external_end
|