diff --git a/tsup.config.ts b/tsup.config.ts index 27625e102..6df08c133 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,7 +1,7 @@ -import { defineConfig, Options } from 'tsup' - -import path from 'path' -import fs from 'fs' +import fs from 'node:fs' +import path from 'node:path' +import type { Options } from 'tsup' +import { defineConfig } from 'tsup' function writeCommonJSEntry() { fs.writeFileSync( @@ -11,12 +11,12 @@ if (process.env.NODE_ENV === 'production') { module.exports = require('./react-redux.production.min.cjs') } else { module.exports = require('./react-redux.development.cjs') -}` +}`, ) } export default defineConfig((options) => { - const commonOptions: Partial = { + const commonOptions: Options = { entry: { 'react-redux': 'src/index.ts', }, @@ -93,9 +93,9 @@ export default defineConfig((options) => { outDir: './dist/cjs/', outExtension: () => ({ js: '.cjs' }), minify: true, - onSuccess: () => { + onSuccess: async () => { writeCommonJSEntry() }, }, - ] + ] as Options[] })