Skip to content

Commit

Permalink
Fix tsup.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Feb 9, 2024
1 parent bcc5864 commit dd89f15
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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<Options> = {
const commonOptions: Options = {
entry: {
'react-redux': 'src/index.ts',
},
Expand Down Expand Up @@ -93,9 +93,9 @@ export default defineConfig((options) => {
outDir: './dist/cjs/',
outExtension: () => ({ js: '.cjs' }),
minify: true,
onSuccess: () => {
onSuccess: async () => {
writeCommonJSEntry()
},
},
]
] as Options[]
})

0 comments on commit dd89f15

Please sign in to comment.