Closed pmcelhaney closed 1 month ago
Latest commit: 39cb07899034682ed1e0baf03d3da6fdedf16f65
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/server/app.ts | 0 | 1 | 0.0% | ||
src/server/module-loader.ts | 10 | 12 | 83.33% | ||
<!-- | Total: | 62 | 65 | 95.38% | --> |
Totals | |
---|---|
Change from base Build 8901772803: | 0.2% |
Covered Lines: | 3063 |
Relevant Lines: | 3537 |
Continuation of #875
In order to hot-reload dependent files, we need to be able to control the module cache. We can do that with CommonJS and
require()
. With ESM, Node doesn't have an API to control the cache.The solution was to always generate CommonJS files and generate
.cjs
extensions so everything will still work inside an ESM project.As it stands, this will break if you require a file with a relative path that is outside the output directory. Not a hard fix, but I doubt anyone is affected and I don't want to deal with it right now.