atscott e88d652f2a Revert "build: upgrade to rules_nodejs 1.0.0 (first stable release) (#34589)" (#34730)
This reverts commit cb6ffa1211bafe35debf6f74f0caee0e2efc420a.

PR Close #34730
2020-01-10 14:12:15 -08:00

31 lines
1.0 KiB
Python

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 = glob(["global/*.js"]) + ["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)",
},
deps = [":locales"],
)