Skip to content

Commit

Permalink
fix: make enableBuild works
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jun 28, 2021
1 parent dd624cd commit 556db26
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/vite-plugin-checker/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ export default function Plugin(userConfig?: UserPluginConfig): Plugin {
},
buildStart: () => {
// for build mode
// Run a bin command in a separated process
// run a bin command in a separated process
if (viteMode !== 'build') return

// do not do anything when disable build mode
if (!enableBuild) return

const localEnv = npmRunPath.env({
env: process.env,
cwd: process.cwd(),
Expand All @@ -96,13 +99,11 @@ export default function Plugin(userConfig?: UserPluginConfig): Plugin {
shell: os.platform() === 'win32',
})

if (enableBuild) {
proc.on('exit', (code) => {
if (code !== null && code !== 0) {
process.exit(code)
}
})
}
proc.on('exit', (code) => {
if (code !== null && code !== 0) {
process.exit(code)
}
})
})
},
configureServer(server) {
Expand Down

0 comments on commit 556db26

Please sign in to comment.