fix(medusa): Hot reloading on Windows (#2105)
This commit is contained in:
1 parent
4c18c9251c
commit
846ae637e2
2 files changed
+11
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
Fix development hot reload on Windows
|
||||
@@ -5,7 +5,7 @@ import chokidar from "chokidar"
|
||||
|
||||
import Logger from "../loaders/logger"
|
||||
|
||||
export default async function ({ port, directory }) {
|
||||
export default async function({ port, directory }) {
|
||||
const args = process.argv
|
||||
args.shift()
|
||||
args.shift()
|
||||
@@ -28,6 +28,11 @@ export default async function ({ port, directory }) {
|
||||
chokidar.watch(`${directory}/src`).on("change", (file) => {
|
||||
const f = file.split("src")[1]
|
||||
Logger.info(`${f} changed: restarting...`)
|
||||
|
||||
if (process.platform === "win32") {
|
||||
execSync(`taskkill /PID ${child.pid} /F /T`)
|
||||
}
|
||||
|
||||
child.kill("SIGINT")
|
||||
|
||||
execSync(`${babelPath} src -d dist --extensions \".ts,.js\"`, {
|
||||
|
||||
Reference in new issue
Block a user