Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/rolldown-plugin-dts. A Rolldown plugin to generate and bundle dts files.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import { rm } from 'node:fs/promises'import path from 'node:path'import { fileURLToPath } from 'node:url'import { expectFilesSnapshot } from '@sxzz/test-utils'import { build } from 'rolldown'import { beforeAll, test } from 'vitest'import { dts } from '../src'
const dirname = path.dirname(fileURLToPath(import.meta.url))const tempDir = path.join(dirname, 'temp')
beforeAll(async () => { await rm(tempDir, { recursive: true, force: true })})
test('oxc', async () => { const dir = path.join(tempDir, 'source-map-oxc') await build({ input: path.resolve(dirname, 'fixtures/basic.ts'), plugins: [ dts({ isolatedDeclarations: true, sourcemap: true, emitDtsOnly: true, }), ], output: { dir }, write: true, }) await expectFilesSnapshot(dir, '__snapshots__/source-map-oxc.md')})
test('tsc', async () => { const dir = path.join(tempDir, 'source-map-tsc') await build({ input: path.resolve(dirname, 'fixtures/basic.ts'), plugins: [ dts({ isolatedDeclarations: false, sourcemap: true, emitDtsOnly: true, }), ], output: { dir }, write: true, }) await expectFilesSnapshot(dir, '__snapshots__/source-map-tsc.md')})