https://github.com/angular/angular
Raw File
Tip revision: 0a2191f8e7e232087aab0a7a9eb9ee6871580267 authored by Alex Rickabaugh on 12 May 2021, 18:13:50 UTC
Revert "refactor(core): optimize calls to `split` and `slice` while computing version parts (#41208)"
Tip revision: 0a2191f
BUILD.bazel
package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm//http-server:index.bzl", "http_server")
load("@npm//@angular/bazel:index.bzl", "ng_module")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver")

# Allow targets under sub-packages to reference the tsconfig.json file
exports_files(["tsconfig.json"])

ng_module(
    name = "src",
    srcs = glob(["*.ts"]),
    generate_ve_shims = True,
    deps = [
        "//src/hello-world",
        "@npm//@angular/common",
        "@npm//@angular/core",
        "@npm//@angular/platform-browser",
        "@npm//@angular/router",
        "@npm//@types",
        "@npm//rxjs",
        "@npm//tslib",
    ],
)

filegroup(
    name = "rxjs_umd_modules",
    srcs = [
        # do not sort
        "@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
        ":rxjs_shims.js",
    ],
)

concatjs_devserver(
    name = "devserver",
    entry_module = "bazel_integration_test/src/main",
    scripts = [
        ":rxjs_umd_modules",
    ],
    # Use the same bundle serving path as prodserver so that we can share
    # an index.html file.
    serving_path = "/bundle.min.js",
    static_files = [
        "index.html",
        "@npm//:node_modules/zone.js/bundles/zone.umd.min.js",
    ],
    deps = ["//src"],
)

rollup_bundle(
    name = "bundle",
    config_file = "rollup.config.js",
    entry_point = ":main.ts",
    deps = [
        "//src",
        "@npm//rollup-plugin-commonjs",
        "@npm//rollup-plugin-node-resolve",
    ],
)

terser_minified(
    name = "bundle.min",
    src = ":bundle",
)

pkg_web(
    name = "prodapp",
    srcs = [
        "index.html",
        ":bundle.min",
        "@npm//:node_modules/zone.js/bundles/zone.umd.min.js",
    ],
)

http_server(
    name = "prodserver",
    data = [":prodapp"],
    templated_args = ["src/prodapp"],
)
back to top