Skip to content

Commit

Permalink
fix: not start launch editor server when disable
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyinws committed Dec 3, 2023
1 parent 23facb2 commit f70947c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,24 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (options =
vite: {
apply: 'serve',
async configureServer() {
if (options.disableLaunchEditor)
return

startServer(mergedOptions.port)
},
},
webpack(compiler) {
if (options.disableLaunchEditor)
return
if (compiler.options.mode === 'development') {
compiler.hooks.done.tap(PLUGIN_NAME, async () => {
startServer(mergedOptions.port)
})
}
},
rspack(compiler) {
if (options.disableLaunchEditor)
return
if (compiler.options.mode === 'development') {
compiler.hooks.done.tap(PLUGIN_NAME, async () => {
startServer(mergedOptions.port)
Expand Down

0 comments on commit f70947c

Please sign in to comment.