Skip to content

Commit

Permalink
chore: remove empty types.cjs and types.mjs from dist
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Nov 15, 2024
1 parent aca62a1 commit 1429682
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { rm } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { defineBuildConfig } from 'unbuild'

const root = fileURLToPath(new URL('./dist', import.meta.url))

export default defineBuildConfig({
entries: [
'src/index.ts',
Expand All @@ -8,10 +13,18 @@ export default defineBuildConfig({
'src/constants.ts',
'src/types.ts',
],
clean: true,
clean: false,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
hooks: {
'build:done': async () => {
await Promise.all([
rm(resolve(root, 'types.cjs')),
rm(resolve(root, 'types.mjs')),
])
},
},
})

0 comments on commit 1429682

Please sign in to comment.