Skip to content

Commit

Permalink
chore(6.0): remove terser package
Browse files Browse the repository at this point in the history
It has been unmaintained for two years and has been replaced by https://github.com/aspect-build/rules_terser/.
  • Loading branch information
jbedard committed Apr 1, 2023
1 parent ec83227 commit 16ba4ad
Show file tree
Hide file tree
Showing 59 changed files with 10 additions and 1,549 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ docs/Built-ins.md linguist-generated=true
docs/Jasmine.md linguist-generated=true
docs/Providers.md linguist-generated=true
docs/Rollup.md linguist-generated=true
docs/Terser.md linguist-generated=true
docs/TypeScript.md linguist-generated=true
1 change: 0 additions & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ _READMES = {
"Jasmine": "//packages/jasmine:README.md",
"Providers": "//docs:providers.md_",
"Rollup": "//packages/rollup:README.md",
"Terser": "//packages/terser:README.md",
}

[
Expand Down
143 changes: 0 additions & 143 deletions docs/Terser.md

This file was deleted.

7 changes: 0 additions & 7 deletions e2e/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ e2e_integration_test(
tags = ["no-bazelci-windows"],
)

# terser rules are tested in the e2e_webapp
test_suite(
name = "e2e_terser",
tests = ["e2e_webapp"],
)

# rollup rules are tested in the e2e_webapp
test_suite(
name = "e2e_rollup",
Expand All @@ -136,7 +130,6 @@ e2e_integration_test(
name = "e2e_webapp",
npm_packages = {
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
},
)

Expand Down
8 changes: 1 addition & 7 deletions e2e/webapp/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")

rollup_bundle(
name = "app",
Expand All @@ -12,13 +11,8 @@ rollup_bundle(
# supports_workers = True,
)

terser_minified(
name = "out.min",
src = "app",
)

nodejs_test(
name = "test",
data = ["out.min"],
data = ["app"],
entry_point = ":test.js",
)
4 changes: 0 additions & 4 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ example_integration_test(
timeout = "long",
npm_packages = {
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = [
Expand Down Expand Up @@ -66,7 +65,6 @@ example_integration_test(
name = "examples_app",
npm_packages = {
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
Expand Down Expand Up @@ -112,7 +110,6 @@ example_integration_test(
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
},
tags = [
# Bintray was removed from the internet, and the version of
Expand Down Expand Up @@ -148,7 +145,6 @@ example_integration_test(
],
npm_packages = {
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
Expand Down
23 changes: 6 additions & 17 deletions examples/angular/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("@npm//@babel/cli:index.bzl", "babel")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@npm//history-server:index.bzl", "history_server")
load("@npm//html-insert-assets:index.bzl", "html_insert_assets")
Expand Down Expand Up @@ -150,16 +149,6 @@ history_server(
templated_args = ["-a $$(rlocation $(rootpath :devapp))"],
)

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

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

html_insert_assets(
name = "inject_scripts_for_prod",
# we can't output "src/example/index.html" since that collides with the devmode file.
Expand All @@ -173,21 +162,21 @@ html_insert_assets(
"--roots=. $(RULEDIR)",
"--assets",
] + ["$(execpath %s)" % s for s in _ASSETS] + [
"--scripts --module $(execpath :bundle-es2015.min)/index.prod.js",
"--scripts --nomodule $(execpath :bundle-es5.min)/index.prod.js",
"--scripts --module $(execpath :bundle-es2015)/index.prod.js",
"--scripts --nomodule $(execpath :bundle-es5)/index.prod.js",
],
data = [
"//src:example/index.html",
":bundle-es2015.min",
":bundle-es5.min",
":bundle-es2015",
":bundle-es5",
] + _ASSETS,
)

pkg_web(
name = "prodapp",
srcs = _ASSETS + [
":bundle-es2015.min",
":bundle-es5.min",
":bundle-es2015",
":bundle-es5",
# each injected index file should be listed here
":inject_scripts_for_prod",
"//src/assets",
Expand Down
8 changes: 1 addition & 7 deletions examples/app/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm//@bazel/protractor:index.bzl", "protractor_web_test_suite")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//@bazel/typescript:index.bzl", "ts_project")
load("@npm//html-insert-assets:index.bzl", "html_insert_assets")
load("@npm//http-server:index.bzl", "http_server")
Expand All @@ -19,13 +18,8 @@ rollup_bundle(
deps = [":app"],
)

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

_ASSETS = [
":bundle.min",
":bundle",
"//styles:base.css",
"//styles:test.css",
]
Expand Down
9 changes: 1 addition & 8 deletions examples/kotlin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", "pkg_web")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_import", "kt_js_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//http-server:index.bzl", "http_server")

# Grab a Maven dependency
Expand Down Expand Up @@ -46,16 +45,10 @@ rollup_bundle(
],
)

terser_minified(
# This will output bundle.min directory since rollup produces a directory
name = "bundle.min",
src = ":bundle",
)

pkg_web(
name = "package",
srcs = [
"bundle.min",
"bundle",
"index.html",
],
)
Expand Down
15 changes: 1 addition & 14 deletions examples/webapp/differential_loading.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm_deps//@babel/cli:index.bzl", "babel")
load("@npm_deps//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm_deps//@bazel/terser:index.bzl", "terser_minified")
load("@npm_deps//@bazel/typescript:index.bzl", "ts_project")

def differential_loading(name, entry_point, srcs):
Expand Down Expand Up @@ -42,23 +41,11 @@ def differential_loading(name, entry_point, srcs):
],
)

# Run terser against both modern and legacy browser chunks
terser_minified(
name = name + "_chunks_es5.min",
src = name + "_chunks_es5",
)

terser_minified(
name = name + "_chunks.min",
src = name + "_chunks",
)

pkg_web(
name = name,
srcs = [
"index.html",
"favicon.png",
name + "_chunks.min",
name + "_chunks_es5.min",
name + "_chunks",
],
)
Loading

0 comments on commit 16ba4ad

Please sign in to comment.