fix: support .d.mts and .d.cts#3000
Conversation
packages/sandbox/src/index.ts
Outdated
| return (firstJS && firstJS.text) || "" | ||
| } | ||
|
|
||
| const isDtsFile = (name: string) => /\.d\.[cm]?ts$/.test(name) |
There was a problem hiding this comment.
You may also want to support .d.*.ts, e.g. .d.css.ts. https://github.com/microsoft/DefinitelyTyped-tools/blob/7a8a32513cbbe5a2af5c3e39e056117b3c14c390/packages/utils/src/miscellany.ts#L97
There was a problem hiding this comment.
Interesting, good to know. Updated
jakebailey
left a comment
There was a problem hiding this comment.
Kinda frustrating that there's no common way to access this one regex, but, oh well.
Not sure how much it matters but it may technically be more performant to store the regexp object off in a var somewhere and reuse it. not sure if V8 performs that optimization or not, though.
Also will require a package release.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3000.centralus.5.azurestaticapps.net |
https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext
For example, package
shikijiis an ESM-only package that only ships.mjsand.d.mts. The ATA failed to work as failed to find.d.tsand start looking for@types/shikiji, which do not exist either:https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgcwKYwBLGQCwDbY4ypRwC+cAZlBCHAOQDOOwA1sAFbD0BQPAxhAB2jeAEM4AXjhiA7mODw0mQgVzEoACgCUQA