forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.bazel
37 lines (31 loc) · 2 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
load("//tools:defaults.bzl", "npm_package", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "locales",
srcs = glob(
["**/*.ts"],
exclude = ["closure-locale.ts"],
),
)
npm_package(
name = "package",
srcs = ["package.json"],
replacements = {
# Workaround for `.d.ts`` containing `/// <amd-module .../>`
# which are generated in TypeScript v2.9, but not before.
"/// <amd-module name=.*/>": "",
# Workaround for https://github.com/angular/angular/issues/23217
# Webpack will detect that the UMD outputs from TypeScript pass the
# `require` function into the module, and cannot accurately track
# dependencies in case require was called.
# We don't actually import anything in the locale code so we can
# null out the require reference passed into the module.
"factory\(require, exports\)": "factory(null, exports)",
# Attach the locale to the global scope at `ng.common.locale...` if not UMD or CommonJS
"\(function \(factory\) {": "(function (root, factory) {",
"}\)\(function \(require, exports\) {": "})(typeof globalThis !== \"undefined\" && globalThis || typeof global !== \"undefined\" && global || typeof window !== \"undefined\" && window || this, function (require, exports) {",
#11111111111111111111111111111111111111111111111111111111222221111111111111111111111111111111111333333331111111111111111111111111111111111111111111114444411
"(if \(typeof define === \"function\" && define.amd\) {\n(\s*)define\(\"@angular/common/locales/([^\"]+)\", \[\"require\", \"exports\"], factory\);\n(\s*)})": "$1 else {\n$2if (typeof root.ng === \"undefined\") root.ng = {};if (typeof root.ng.common === \"undefined\") root.ng.common = {};if (typeof root.ng.common.locale === \"undefined\") root.ng.common.locale = {};var container = {};factory(null, container);root.ng.common.locale[\"$3\"] = container.default;\n$4}",
},
deps = [":locales"],
)