From 19a37687b82994c1c2454ec118d30960a2659b85 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 27 Jul 2021 09:44:46 +0800 Subject: [PATCH] feat: expose raw object --- src/define.ts | 3 +++ src/types.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/define.ts b/src/define.ts index ef296dad..c370e1af 100644 --- a/src/define.ts +++ b/src/define.ts @@ -15,6 +15,9 @@ export function createUnplugin ( }, get webpack () { return getWebpackPlugin(factory) + }, + get raw () { + return factory } } } diff --git a/src/types.ts b/src/types.ts index e17e708f..08cbc2a9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -34,6 +34,7 @@ export interface UnpluginInstance { rollup: (options?: UserOptions) => RollupPlugin; webpack: (options?: UserOptions) => any; vite: (options?: UserOptions) => VitePlugin; + raw: UnpluginFactory } declare module 'webpack' {