Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 10, 2023
1 parent c82f65c commit 28b2c9f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/build-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
FullExportCondition,
} from './types'
import type { InputOptions, OutputOptions, Plugin } from 'rollup'
import { type TypescriptOptions } from './typescript'
import { convertCompilerOptions, type TypescriptOptions } from './typescript'

Check failure on line 11 in src/build-config.ts

View workflow job for this annotation

GitHub Actions / Node 18

'convertCompilerOptions' is declared but its value is never read.

Check failure on line 11 in src/build-config.ts

View workflow job for this annotation

GitHub Actions / Node 20

'convertCompilerOptions' is declared but its value is never read.

import { resolve, dirname } from 'path'
import { wasm } from '@rollup/plugin-wasm'
Expand Down Expand Up @@ -132,7 +132,10 @@ async function buildInputConfig(
declarationMap: false,
skipLibCheck: true,
preserveSymlinks: false,
// disable incremental build
incremental: false,
// use default tsBuildInfoFile value
tsBuildInfoFile: '.tsbuildinfo',
target: 'esnext',
module: 'esnext',
jsx: tsCompilerOptions.jsx || 'react',
Expand All @@ -144,17 +147,22 @@ async function buildInputConfig(
]

if (useTypescript) {
const mergedOptions = {
...baseResolvedTsOptions,
...tsCompilerOptions,
}

// error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single
// file or when option '--tsBuildInfoFile' is specified.
delete mergedOptions.incremental

const dtsPlugin = (require('rollup-plugin-dts') as typeof import('rollup-plugin-dts')).default({
tsconfig: tsConfigPath,
compilerOptions: {
...baseResolvedTsOptions,
...tsCompilerOptions,
},
tsconfig: undefined,
compilerOptions: mergedOptions,
})
typesPlugins.push(dtsPlugin)
}


const plugins: Plugin[] = (
dts
? typesPlugins
Expand Down

0 comments on commit 28b2c9f

Please sign in to comment.