Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"dist"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch src",
"build": "tsdown",
"dev": "tsdown --watch src",
"lint": "eslint .",
"play": "npm -C playground run dev",
"prepublishOnly": "npm run build",
Expand Down Expand Up @@ -131,7 +131,7 @@
"eslint": "^9.20.0",
"nodemon": "^3.1.9",
"rollup": "^4.34.6",
"tsup": "^8.3.6",
"tsdown": "^0.6.10",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"vite": "^6.1.0",
Expand Down
1 change: 1 addition & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "module",
"private": true,
"scripts": {
"dev": "nodemon -w '../src/**/*.ts' -e .ts -x vite"
Expand Down
3 changes: 2 additions & 1 deletion src/esbuild.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createEsbuildPlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createEsbuildPlugin(unpluginFactory)
export default createEsbuildPlugin(unpluginFactory) as ReturnType<typeof createEsbuildPlugin<Options | undefined>>
3 changes: 2 additions & 1 deletion src/farm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createFarmPlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createFarmPlugin(unpluginFactory)
export default createFarmPlugin(unpluginFactory) as ReturnType<typeof createFarmPlugin<Options | undefined>>
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UnpluginFactory } from 'unplugin'
import type { UnpluginFactory, UnpluginInstance } from 'unplugin'
import type { Options } from './types'
import { createUnplugin } from 'unplugin'

Expand All @@ -12,6 +12,6 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = options =>
},
})

export const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory)
export const unplugin: UnpluginInstance<Options | undefined> = /* #__PURE__ */ createUnplugin(unpluginFactory)

export default unplugin
4 changes: 2 additions & 2 deletions src/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { NuxtModule } from '@nuxt/schema'
import type { Options } from './types'
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'
import vite from './vite'
import webpack from './webpack'
import '@nuxt/schema'

export interface ModuleOptions extends Options {

Expand All @@ -22,4 +22,4 @@ export default defineNuxtModule<ModuleOptions>({

// ...
},
})
}) as ReturnType<NuxtModule<ModuleOptions>>
3 changes: 2 additions & 1 deletion src/rollup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createRollupPlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createRollupPlugin(unpluginFactory)
export default createRollupPlugin(unpluginFactory) as ReturnType<typeof createRollupPlugin<Options | undefined>>
3 changes: 2 additions & 1 deletion src/rspack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createRspackPlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createRspackPlugin(unpluginFactory)
export default createRspackPlugin(unpluginFactory) as ReturnType<typeof createRspackPlugin<Options | undefined>>
3 changes: 2 additions & 1 deletion src/vite.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createVitePlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createVitePlugin(unpluginFactory)
export default createVitePlugin(unpluginFactory) as ReturnType<typeof createVitePlugin<Options | undefined>>
3 changes: 2 additions & 1 deletion src/webpack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Options } from './types'
import { createWebpackPlugin } from 'unplugin'
import { unpluginFactory } from '.'

export default createWebpackPlugin(unpluginFactory)
export default createWebpackPlugin(unpluginFactory) as ReturnType<typeof createWebpackPlugin<Options | undefined>>
12 changes: 12 additions & 0 deletions tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'tsdown'

export default defineConfig({
entry: [
'src/*.ts',
],
clean: true,
format: ['cjs', 'esm'],
dts: true,
bundleDts: true,
sourcemap: true,
})
12 changes: 0 additions & 12 deletions tsup.config.ts

This file was deleted.

Loading