-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: upgrade to unbuild@2
#161
Conversation
if (existsSync(dtsFile)) { | ||
return | ||
} | ||
|
||
// Read generated module types | ||
const moduleTypesFile = resolve(distDir, 'module.d.ts') | ||
const moduleTypes = await fsp.readFile(moduleTypesFile, 'utf8').catch(() => '') | ||
const typeExports = findExports(moduleTypes) | ||
const typeExports = findExports( | ||
// Replace `export { type Foo }` with `export { Foo }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to Swatinem/rollup-plugin-dts@1b228d0
I am uncertain if such a feature should be included in mlly
as findExports
is used to find non-type exports. While fineTypeExports
finds types exports only. But in .d.ts
actually, all exports are type exports with or without the type
indicator.
Resolves #151 |
@@ -19,11 +19,14 @@ describe('module builder', () => { | |||
expect(files).toMatchInlineSnapshot(` | |||
[ | |||
"module.cjs", | |||
"module.d.mts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if out the box we would generate mts and cts 🙏🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
Resolves #151