From 01047901fbb93b29d16ca95d05bd1bc43f5d096a Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 13 Jul 2021 00:55:21 +0800 Subject: [PATCH] refactor: rename `defineUnplugin` to `createUnplugin` --- README.md | 4 ++-- siroc.config.ts | 5 ----- src/define.ts | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 siroc.config.ts diff --git a/README.md b/README.md index 10324953..b7718b41 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ ## Usage ```ts -import { defineUnplugin } from 'unplugin' +import { createUnplugin } from 'unplugin' -const plugin = defineUnplugin((options: UserOptions) => { +const plugin = createUnplugin((options: UserOptions) => { return { name: 'my-first-unplugin', // webpack's id filter is outside of loader logic, diff --git a/siroc.config.ts b/siroc.config.ts deleted file mode 100644 index 694192b3..00000000 --- a/siroc.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineSirocConfig } from 'siroc' - -export default defineSirocConfig({ - -}) diff --git a/src/define.ts b/src/define.ts index def1cd74..200f70c0 100644 --- a/src/define.ts +++ b/src/define.ts @@ -2,7 +2,7 @@ import { getRollupPlugin } from './rollup' import { UnpluginInstance, UnpluginFactory } from './types' import { getWebpackPlugin } from './webpack' -export function defineUnplugin ( +export function createUnplugin ( factory: UnpluginFactory ): UnpluginInstance { return {