From 690684d59b657a9b676656f65b7b3cc37e7647ae Mon Sep 17 00:00:00 2001 From: Percy Ma Date: Mon, 5 Sep 2022 17:31:25 +0800 Subject: [PATCH] fix: no config needed, out of the box --- src/esbuild.ts | 4 ++-- src/index.ts | 2 +- src/rollup.ts | 4 ++-- src/vite.ts | 4 ++-- src/webpack.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/esbuild.ts b/src/esbuild.ts index 71f1e095..26a5bb27 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 f2f406bc..330fc8fa 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 ed6909cd..90c0c304 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 589f4b96..fa6b4279 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 83091ee3..713bcf9e 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;