-
Notifications
You must be signed in to change notification settings - Fork 522
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
rollup_bundle srcs are not visible to files reachable from entry_point #1698
Comments
The same thing happens to data carried from a dependency to Assume this change to the rule: diff --git a/packages/rollup/src/rollup_bundle.bzl b/packages/rollup/src/rollup_bundle.bzl
index f5cf732d..3b2abb76 100644
--- a/packages/rollup/src/rollup_bundle.bzl
+++ b/packages/rollup/src/rollup_bundle.bzl
@@ -394,7 +394,13 @@ def _rollup_bundle(ctx):
)
return [
- DefaultInfo(files = depset(outputs)),
+ DefaultInfo(
+ files = depset(outputs),
+ runfiles = ctx.runfiles(
+ collect_default = True,
+ collect_data = True,
+ ),
+ ),
]
rollup_bundle = rule( Then, the rules: ts_library(
name = "lib",
srcs = glob([
"src/**/*.ts",
]),
tsconfig = "tsconfig",
data = [file.json],
)
rollup_bundle(
name = "bundle",
config_file = "rollup.config.js",
entry_point = "src/index.ts",
format = "iife",
output_dir = False,
sourcemap = "inline",
deps = [":lib"] Then, in rollup's run_files, the js files of Is the correct fix should be to have |
I think I'm running into an issue with this root cause. In the meantime is there any way to make css visible via rollup? |
Ended up using copy_to_bin as suggested in #1771. However, it would be great if this use case was better supported. |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?" |
🐞 bug report
Affected Rule
The issue is caused by the rule:rollup_bundle()
Description
Including a file in the
rollup_bundle
srcs
doesn't make it available toentry_point
files.Assuming I add
tailwind.css
tosrcs
, it is available at.../execroot/root/pkg/tailwind.css
. My index file, on the other hand, is at.../execroot/root/bazel-out/darwin-dbg/bin/pkg/src/index.mjs
.🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)Anything else relevant?
The text was updated successfully, but these errors were encountered: