Repository navigation
fix: resolve paths in config - #84
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tsconfig
pathsaliases did not work in the config, data modules, partials, or content data modules.loadModule()marked each bare id, such as~/lib/menu, as an external package, so the import failed at run time withCannot find package '~'. Scripts were not affected, since they do not use this plugin.Changes
node_modulesfolder above the importer has a package of that name, the packages plugin asks Rolldown's resolver, which appliespaths. A result outsidenode_modulesis local code, and is bundled like a relative import.link()is split in two:installed()finds thenode_modulesentry, andlink()reads its symlink. An installed package never reaches the new resolve, so bongo itself stays one copy when it is linked.config.md.Benchmark
loadModule()frommainand from this branch, in one process, 40 alternating runs after 5 warm-up runs, M1 Max. Times in ms:mainmedian / p90bench/sitedocsThe differences are within noise: an installed package does not resolve again. When the new path runs, 8 alias imports take 1.84 ms median, and the same 8 imports as relative paths take 1.78 ms.
Full bench
bun bench/index.ts site --runs 5, 6 pairs, alternating:mainfirst in pairs 1–3, the branch first in pairs 4–6. Wall is the median of 5 fresh builds of 10,000 pages; the config stage is from the profile run.mainwallmainconfig stageNeither side is faster in every pair. Pair 1 is the outlier: its branch runs spread from 2.20 s to 2.77 s. Every run wrote the same output, sha256
71e146856b298c20.Test plan
bun test(853 pass),bunx tsc -p .,bunx tsc -p build,bun run buildbuild()test fails onmain: the config, a data module, a partial, and a content data module each import through~/node_modulescheck~/tbuilds with the CLI