diff --git a/src/esbuild.ts b/src/esbuild.ts index 71f1e0952..26a5bb27f 100644 --- a/src/esbuild.ts +++ b/src/esbuild.ts @@ -1,3 +1,3 @@ -import unplugin from '.' +import unplugin, { Options } from '.' -export default unplugin.esbuild +export default unplugin.esbuild as (options?: Options) => any; diff --git a/src/index.ts b/src/index.ts index f2f406bc3..330fc8fa3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,7 @@ import { join } from 'pathe' export { Options } -export default createUnplugin((opt, meta) => { +export default createUnplugin((opt = {}, meta) => { const options = resolveOptions(opt) const ctx = createRoutesContext(options) diff --git a/src/rollup.ts b/src/rollup.ts index ed6909cd3..90c0c3041 100644 --- a/src/rollup.ts +++ b/src/rollup.ts @@ -1,3 +1,3 @@ -import unplugin from '.' +import unplugin, { Options } from '.' -export default unplugin.rollup +export default unplugin.rollup as (options?: Options) => any; diff --git a/src/vite.ts b/src/vite.ts index 589f4b964..fa6b42796 100644 --- a/src/vite.ts +++ b/src/vite.ts @@ -1,3 +1,3 @@ -import unplugin from '.' +import unplugin, { Options } from '.' -export default unplugin.vite +export default unplugin.vite as (options?: Options) => any; diff --git a/src/webpack.ts b/src/webpack.ts index 83091ee31..713bcf9e9 100644 --- a/src/webpack.ts +++ b/src/webpack.ts @@ -1,3 +1,3 @@ -import unplugin from '.' +import unplugin, { Options } from '.' -export default unplugin.webpack +export default unplugin.webpack as (options?: Options) => any;