Skip to content
Merged
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
11 changes: 11 additions & 0 deletions dist/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9830,6 +9830,17 @@ const jsenvPluginWorkspaceBundle = ({ packageDirectory }) => {
// main is node-only code (node:url) that cannot be served to a browser.
return null;
}
const ownerPackageDirectoryUrl = packageDirectory.find(
reference.ownerUrlInfo.url,
);
if (ownerPackageDirectoryUrl === packageDirectoryUrl) {
// Import between two files of the same package: the owner was reached
// outside the package bundle (an HTML <script src> entry point, see
// above). Consolidation only applies to references crossing into a
// package from outside; redirecting an intra-package relative import
// to the package main would run the wrong module.
return null;
}
// we make sure we target the bundle version of the package
// otherwise we might execute some parts of the package code multiple times.
// so we need to redirect the potential reference to non entry point to the package main entry point
Expand Down
11 changes: 11 additions & 0 deletions dist/start_dev_server/start_dev_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7680,6 +7680,17 @@ const jsenvPluginWorkspaceBundle = ({ packageDirectory }) => {
// main is node-only code (node:url) that cannot be served to a browser.
return null;
}
const ownerPackageDirectoryUrl = packageDirectory.find(
reference.ownerUrlInfo.url,
);
if (ownerPackageDirectoryUrl === packageDirectoryUrl) {
// Import between two files of the same package: the owner was reached
// outside the package bundle (an HTML <script src> entry point, see
// above). Consolidation only applies to references crossing into a
// package from outside; redirecting an intra-package relative import
// to the package main would run the wrong module.
return null;
}
// we make sure we target the bundle version of the package
// otherwise we might execute some parts of the package code multiple times.
// so we need to redirect the potential reference to non entry point to the package main entry point
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/core",
"version": "41.4.15",
"version": "41.4.16",
"type": "module",
"description": "Tool to develop, test and build js projects",
"repository": {
Expand Down
Loading
Loading