Skip to content

Commit 8cdc8bb

Browse files
committed
Use env.command instead of env.mode
1 parent 9bf3edf commit 8cdc8bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export const nodePolyfills = (options: PolyfillOptions = {}): Plugin => {
180180
return {
181181
name: 'vite-plugin-node-polyfills',
182182
config: (config, env) => {
183-
const isDev = env.mode === 'development'
183+
const isDev = env.command === 'serve'
184184
const polyfills = (Object.entries(stdLibBrowser) as Array<[ModuleName, string]>).reduce<Record<ModuleName, string>>((included, [name, value]) => {
185185
if (!optionsResolved.protocolImports) {
186186
if (isProtocolImport(name)) {

0 commit comments

Comments
 (0)