Skip to content

Commit 1e6a99e

Browse files
committed
Fix type issues in tsup.config.ts
1 parent 11e7a50 commit 1e6a99e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tsup.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import fs from 'node:fs'
1+
import fs from 'node:fs/promises'
22
import path from 'node:path'
33
import type { Options } from 'tsup'
44
import { defineConfig } from 'tsup'
55

6-
function writeCommonJSEntry() {
7-
fs.writeFileSync(
6+
async function writeCommonJSEntry() {
7+
await fs.writeFile(
88
path.join('dist/cjs/', 'index.js'),
99
`'use strict'
1010
if (process.env.NODE_ENV === 'production') {
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV === 'production') {
1717

1818
const tsconfig = 'tsconfig.build.json' satisfies Options['tsconfig']
1919

20-
export default defineConfig((options) => {
20+
export default defineConfig((options): Options[] => {
2121
const commonOptions: Options = {
2222
entry: {
2323
'react-redux': 'src/index.ts',
@@ -97,8 +97,8 @@ export default defineConfig((options) => {
9797
outExtension: () => ({ js: '.cjs' }),
9898
minify: true,
9999
onSuccess: async () => {
100-
writeCommonJSEntry()
100+
await writeCommonJSEntry()
101101
},
102102
},
103-
] as Options[]
103+
]
104104
})

0 commit comments

Comments
 (0)