0.6.8 • Published 1 year ago
unplugin-isolated-decl v0.6.8
unplugin-isolated-decl 
⚡️ A blazing-fast tool for generating isolated declarations.
Features
- 🚀 Fast: Generates
.d.tsfiles significantly faster thantsc. - 🎨 Transformer: Support Oxc, SWC, and TypeScript transformer.
- 📦 Zero Config: No configuration required, works out of the box.
- ✨ Bundler Support: Works with Vite, Rollup, and esbuild.
Installation
npm i -D unplugin-isolated-declUsage
// vite.config.ts
import UnpluginIsolatedDecl from 'unplugin-isolated-decl/vite'
export default defineConfig({
plugins: [UnpluginIsolatedDecl()],
})// rollup.config.js
import UnpluginIsolatedDecl from 'unplugin-isolated-decl/rollup'
export default {
plugins: [UnpluginIsolatedDecl()],
}// rolldown.config.js
import UnpluginIsolatedDecl from 'unplugin-isolated-decl/rolldown'
export default {
plugins: [UnpluginIsolatedDecl()],
}// esbuild.config.js
import { build } from 'esbuild'
build({
plugins: [require('unplugin-isolated-decl/esbuild')()],
})Options
export interface Options {
include?: FilterPattern
exclude?: FilterPattern
enforce?: 'pre' | 'post' | undefined
/**
* You need to install one of the supported transformers yourself.
* @default typescript
*/
transformer?: 'oxc' | 'swc' | 'typescript'
/** Only for typescript transformer */
transformOptions?: TranspileOptions
ignoreErrors?: boolean
/** An extra directory layer for output files. */
extraOutdir?: string
/** Automatically add `.js` extension to resolve in `Node16` + ESM mode. */
autoAddExts?: boolean
}autoAddExts
Automatically add .js extension to resolve in Node 16+ ESM mode.
// index.d.ts
import {} from './foo'With autoAddExts, it will be transformed to:
// index.d.ts
import {} from './foo.js'patchCjsDefaultExport
Patch export default in .d.cts to export =
Sponsors
License
0.6.8
1 year ago
0.6.7
1 year ago
0.6.6
2 years ago
0.6.3
2 years ago
0.6.2
2 years ago
0.6.5
2 years ago
0.6.4
2 years ago
0.5.0
2 years ago
0.6.1
2 years ago
0.5.2
2 years ago
0.6.0
2 years ago
0.5.1
2 years ago
0.4.7
2 years ago
0.4.6
2 years ago
0.4.5
2 years ago
0.4.4
2 years ago
0.4.3
2 years ago
0.4.2
2 years ago
0.4.1
2 years ago
0.4.0
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago
0.0.1-beta.2
2 years ago
0.0.1-beta.1
2 years ago