example/prototol_buffers shows "Uncaught ReferenceError: exports is not defined" error
🐞 bug report
Affected Rule
Not a rule
Is this a regression?
Not sure
Description
I try to package the bundle.min with a index.html, it shows Uncaught ReferenceError: exports is not defined when I try to open it in browser.
pkg rule
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
pkg_web(
name = "web",
srcs = [
"index.html",
"bundle.min",
],
)
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test title</title>
<script type="module" src="./bundle.min.js"></script>
</head>
<body>
<h2>Test body</h2>
</body>
</html>
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Operating System:
VERSION="20.04.3 LTS (Focal Fossa)"
Output of bazel version:
Build label: 4.2.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 2 18:15:58 2021 (1638468958)
Build timestamp: 1638468958
Build timestamp as int: 1638468958
Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)
Anything else relevant?
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. 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 30 days without any activity since it was labeled "Can Close?"