Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove swc workaround #97

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# Settings that apply only to CI are in .github/workflows/ci.bazelrc

build --enable_runfiles
# Workaround for https://github.com/swc-project/swc/issues/4057
# Turn off sandboxing so SWC doesn't observe symlinked inputs.
build --modify_execution_info=SWCTranspile=+no-sandbox

# Load any settings specific to the current user.
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ load("//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
name = "default_swc",
node_repository = "node16",
swc_version = "v1.2.168",
swc_version = "v1.2.241",
)

load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
Expand Down
6 changes: 0 additions & 6 deletions docs/swc.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions examples/custom_outs/expected.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.a = void 0;
Object.defineProperty(exports, "a", {
enumerable: true,
get: function() {
return a;
}
});
var a = "a";
exports.a = a;


//# sourceMappingURL=out.cjs.map
4 changes: 0 additions & 4 deletions examples/paths/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Note that this example also depends on the setup in /WORKSPACE at the root of th
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@aspect_rules_swc//swc:defs.bzl", "swc")

# Note: this example depends on a .bazelrc setting
# build --modify_execution_info=SWCTranspile=+no-sandbox
# to turn off Bazel sandboxing as a workaround for an SWC bug
# https://github.com/swc-project/swc/issues/4057
swc(
name = "transpile",
swcrc = ".swcrc",
Expand Down
13 changes: 10 additions & 3 deletions examples/paths/expected.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions examples/rc/src/expected.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/rc/src/expected.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions swc/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ load("@aspect_rules_swc//swc:defs.bzl", "swc")

swc(name = "transpile")
```

Known issues:
- import statements improperly transformed when using symlinks: [swc#4057](https://github.com/swc-project/swc/issues/4057)
See https://github.com/aspect-build/rules_swc/issues/31.
You can add this to your `.bazelrc` to workaround by disabling sandboxing for SWC actions:
`build --modify_execution_info=SWCTranspile=+no-sandbox`
"""

load("//swc/private:swc.bzl", _swc_lib = "swc")
Expand Down