Skip to content

Commit 90780c3

Browse files
committed
refactor: clean code
1 parent ee50bae commit 90780c3

File tree

1 file changed

+4
-4
lines changed
  • packages/vite-plugin-checker/src

1 file changed

+4
-4
lines changed

packages/vite-plugin-checker/src/main.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function checker(userConfig: UserPluginConfig): Plugin {
6161
let initialized = false
6262
let initializeCounter = 0
6363
let checkers: ServeAndBuildChecker[] = []
64-
let skipRuntime = false
64+
let isProduction = false
6565
let devBase = '/'
6666
let viteMode: ConfigEnv['command'] | undefined
6767
let buildWatch = false
@@ -99,7 +99,7 @@ export function checker(userConfig: UserPluginConfig): Plugin {
9999
configResolved(config) {
100100
logger = config.logger
101101
devBase = config.base
102-
skipRuntime ||= config.isProduction || config.command === 'build'
102+
isProduction ||= config.isProduction || config.command === 'build'
103103
buildWatch = !!config.build.watch
104104
},
105105
buildEnd() {
@@ -132,7 +132,7 @@ export function checker(userConfig: UserPluginConfig): Plugin {
132132
},
133133
transformIndexHtml() {
134134
if (initialized) return
135-
if (skipRuntime) return
135+
if (isProduction) return
136136

137137
return [
138138
{
@@ -146,7 +146,7 @@ export function checker(userConfig: UserPluginConfig): Plugin {
146146
if (initialized) return
147147
// only run in build mode
148148
// run a bin command in a separated process
149-
if (!skipRuntime || !enableBuild) return
149+
if (!isProduction || !enableBuild) return
150150

151151
const localEnv = npmRunPath.env({
152152
env: process.env,

0 commit comments

Comments
 (0)