Skip to content
This repository was archived by the owner on Jun 5, 2021. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/web_bundle/create_webpack_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = (

const base = path.join(process.cwd(), sourceDir)
const gendir = path.join(base, process.env["GENDIR"], '..', 'bin')
const gendir2 = path.join(base, process.env["GENDIR"])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should instead simply update gendir by removing '..', 'bin'?

If we indeed need both, then it would be worth renaming each to better represent what it's used for, and add a comment with an example where it would be necessary.

Bonus points if you add an example running in CI that highlights the need for this 😅


return {
entry: (sourceDir.startsWith("/") ? "" : "./") + path.join(
Expand Down Expand Up @@ -232,6 +233,7 @@ module.exports = (
path.join(loadersNpmPackagesDir, "node_modules"),
base,
gendir,
gendir2,
]
},
resolveLoader: {
Expand Down
2 changes: 1 addition & 1 deletion internal/web_bundle/rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ server.listen(port, 'localhost', function (err) {{
ctx.actions.write(
output = ctx.outputs.devserver,
is_executable = True,
content = "NODE_PATH=" + ctx.attr._internal_packages[NpmPackagesInfo].installed_dir.short_path + "/node_modules " + ctx.file._internal_nodejs.path + " " + webpack_devserver_js.short_path,
content = "GENDIR=" + ctx.var["GENDIR"] + " NODE_PATH=" + ctx.attr._internal_packages[NpmPackagesInfo].installed_dir.short_path + "/node_modules " + ctx.file._internal_nodejs.path + " " + webpack_devserver_js.short_path,
)

return [
Expand Down