Skip to content

Commit 12c59ac

Browse files
committed
Aesthetic edits
1 parent 96b0dd6 commit 12c59ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import type { Plugin } from 'rollup'
66
type MaybeFalsy<T> = (T) | undefined | null | false
77
type MaybeArray<T> = (T) | (T)[]
88

9+
interface ViteCompatiblePlugin extends Plugin {
10+
enforce: 'pre' | 'post'
11+
}
12+
913
export interface ExternalsOptions {
1014

1115
/**
@@ -134,7 +138,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
134138
return {
135139
name: name.replace(/^rollup-plugin-/, ''),
136140
version,
137-
enforce: 'pre', // For Vite
141+
enforce: 'pre',
138142

139143
async buildStart() {
140144

@@ -259,7 +263,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
259263
: null // normal handling
260264
}
261265
}
262-
} as Plugin & { enforce: 'pre' | 'post' }
266+
} as ViteCompatiblePlugin
263267
}
264268

265269
export default nodeExternals

0 commit comments

Comments
 (0)