Skip to content

Commit

Permalink
refactor: remove globals attr from rollup_bundle
Browse files Browse the repository at this point in the history
It repeats what you can do in the rollup.config.js without a good reason

Also remove the fixture that was testing against the goldens of the old
rollup_bundle rule - we'll have new integration test for new impl so
that one served its purpose during the re-implementation.
  • Loading branch information
alexeagle committed Sep 26, 2019
1 parent 94abf68 commit 2904c6c
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 164 deletions.
3 changes: 0 additions & 3 deletions internal/rollup/test/rollup/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle")
load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test")

# Tests in the new implementation want to reuse the golden files
exports_files(glob(["*.js_"]))

rollup_bundle(
name = "bundle",
srcs = ["bar.js"],
Expand Down
13 changes: 0 additions & 13 deletions packages/rollup/src/rollup_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ Either this attribute or `entry_point` must be specified, but not both.
values = ["amd", "cjs", "esm", "iife", "umd", "system"],
default = "esm",
),
"globals": attr.string_dict(
doc = """Specifies id: variableName pairs necessary for external imports in umd/iife bundles.
Passed to the [`--globals` option](https://github.com/rollup/rollup/blob/master/docs/999-big-list-of-options.md#outputglobals) in Rollup.
Also, the keys from the map are passed to the [`--external` option](https://github.com/rollup/rollup/blob/master/docs/999-big-list-of-options.md#external).
""",
),
"output_dir": attr.bool(
doc = """Whether to produce a directory output.
Expand Down Expand Up @@ -277,12 +270,6 @@ def _rollup_bundle(ctx):
if (ctx.attr.sourcemap and ctx.attr.sourcemap != "false"):
args.add_all(["--sourcemap", ctx.attr.sourcemap])

if ctx.attr.globals:
args.add("--external")
args.add_joined(ctx.attr.globals.keys(), join_with = ",")
args.add("--globals")
args.add_joined(["%s:%s" % g for g in ctx.attr.globals.items()], join_with = ",")

ctx.actions.run(
progress_message = "Bundling JavaScript %s [rollup]" % outputs[0].short_path,
executable = ctx.executable.rollup_bin,
Expand Down
16 changes: 0 additions & 16 deletions packages/rollup/test/globals/BUILD.bazel

This file was deleted.

9 changes: 0 additions & 9 deletions packages/rollup/test/globals/golden.js_

This file was deleted.

3 changes: 0 additions & 3 deletions packages/rollup/test/globals/input.js

This file was deleted.

36 changes: 0 additions & 36 deletions packages/rollup/test/integration_e2e_rollup/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion packages/rollup/test/integration_e2e_rollup/bar.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/rollup/test/integration_e2e_rollup/file.js

This file was deleted.

32 changes: 0 additions & 32 deletions packages/rollup/test/integration_e2e_rollup/foo.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/rollup/test/integration_e2e_rollup/fum/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion packages/rollup/test/integration_e2e_rollup/fum/index.js

This file was deleted.

34 changes: 0 additions & 34 deletions packages/rollup/test/integration_e2e_rollup/rollup.config.js

This file was deleted.

0 comments on commit 2904c6c

Please sign in to comment.