Skip to content

Commit

Permalink
feat!: upgrade to unplugin v2, drop webpack 4 and node 16 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Dec 27, 2024
1 parent d612dd1 commit 361277b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ const unplugin: UnpluginInstance<Options | undefined, false> = createUnplugin(
let contents = await readFile(file, 'utf-8')
if (transformFilter(file)) {
let transform: typeof import('esbuild').transform
if (meta.framework === 'esbuild') {
;({ transform } = meta.build!.esbuild)
const nativeContext = this.getNativeBuildContext?.()
if (nativeContext?.framework === 'esbuild') {
;({ transform } = nativeContext.build.esbuild)
} else {
transform = (await import('esbuild')).transform
}
Expand Down

0 comments on commit 361277b

Please sign in to comment.