Skip to content

Commit

Permalink
Aesthetic edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Septh committed May 7, 2024
1 parent 96b0dd6 commit 12c59ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import type { Plugin } from 'rollup'
type MaybeFalsy<T> = (T) | undefined | null | false
type MaybeArray<T> = (T) | (T)[]

interface ViteCompatiblePlugin extends Plugin {
enforce: 'pre' | 'post'
}

export interface ExternalsOptions {

/**
Expand Down Expand Up @@ -134,7 +138,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
return {
name: name.replace(/^rollup-plugin-/, ''),
version,
enforce: 'pre', // For Vite
enforce: 'pre',

async buildStart() {

Expand Down Expand Up @@ -259,7 +263,7 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
: null // normal handling
}
}
} as Plugin & { enforce: 'pre' | 'post' }
} as ViteCompatiblePlugin
}

export default nodeExternals
Expand Down

0 comments on commit 12c59ac

Please sign in to comment.