Skip to content

Commit

Permalink
Provide the correct tsconfig to tsup
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Feb 9, 2024
1 parent 3b199ba commit d887a9c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'

Expand All @@ -15,13 +16,23 @@ if (process.env.NODE_ENV === 'production') {
)
}

// No __dirname under Node ESM
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const tsconfig = path.join(
__dirname,
'./tsconfig.build.json',
) satisfies Options['tsconfig']

export default defineConfig((options) => {
const commonOptions: Options = {
entry: {
'react-redux': 'src/index.ts',
},
sourcemap: true,
target: 'es2020',
tsconfig,
...options,
}

Expand Down

0 comments on commit d887a9c

Please sign in to comment.