blob: 7db6447d7d8dd5c8bd560ebb863ba7e014256ca1 [file]
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//:defs.bzl", "nodejs_binary")
licenses(["notice"]) # Apache 2.0
package(default_visibility = ["//internal:__subpackages__"])
exports_files([
"no_explore.html",
"rollup.config.js",
"system.config.js",
# Exported to be consumed for generating skydoc.
"rollup_bundle.bzl",
])
bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]),
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "rollup",
# Allow --define=ROLLUP_BUNDLE_FIXED_CHUNK_NAMES=1 to be passed as
# process.env so we can give predictable chunk names in CI
configuration_env_vars = ["ROLLUP_BUNDLE_FIXED_CHUNK_NAMES"],
entry_point = "@build_bazel_rules_nodejs_rollup_deps//:node_modules/rollup/bin/rollup",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "tsc",
entry_point = "@build_bazel_rules_nodejs_rollup_deps//:node_modules/typescript/bin/tsc",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "terser",
entry_point = "@build_bazel_rules_nodejs_rollup_deps//:node_modules/terser/bin/uglifyjs",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "terser-wrapped",
data = [":terser-wrapped.js"],
entry_point = ":terser-wrapped.js",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "tsc-directory",
data = [":tsc-directory.js"],
entry_point = ":tsc-directory.js",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
nodejs_binary(
name = "source-map-explorer",
entry_point = "@build_bazel_rules_nodejs_rollup_deps//:node_modules/source-map-explorer/index.js",
install_source_map_support = False,
node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules",
visibility = ["//visibility:public"],
)
# BEGIN-INTERNAL
# TODO: switch to npm_bazel_jasmine
# buildozer: disable=load-on-top
# buildozer: disable=out-of-order-load
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
jasmine_node_test(
name = "test",
srcs = glob(["*.spec.js"]),
data = glob(
["*.js"],
exclude = ["*.spec.js"],
),
deps = [
"@npm//is-builtin-module",
"@npm//jasmine",
"@npm//rollup",
"@npm//rollup-plugin-amd",
"@npm//rollup-plugin-commonjs",
"@npm//rollup-plugin-json",
"@npm//rollup-plugin-node-resolve",
"@npm//rollup-plugin-sourcemaps",
],
)
# END-INTERNAL
filegroup(
name = "package_contents",
srcs = glob(
["*"],
exclude = ["*.spec.js"],
),
visibility = ["//:__pkg__"],
)