fix(medusa): medusa develop does not take execArgv into account properly (#4338)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): medusa develop does not take execArgv into account properly
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
import path from "path"
|
import path from "path"
|
||||||
import { fork, execSync } from "child_process"
|
import { execSync, fork } from "child_process"
|
||||||
import boxen from "boxen"
|
import boxen from "boxen"
|
||||||
import chokidar from "chokidar"
|
import chokidar from "chokidar"
|
||||||
import Store from "medusa-telemetry/dist/store"
|
import Store from "medusa-telemetry/dist/store"
|
||||||
import { EOL } from "os"
|
import { EOL } from "os"
|
||||||
import path from "path"
|
|
||||||
|
|
||||||
import Logger from "../loaders/logger"
|
import Logger from "../loaders/logger"
|
||||||
|
|
||||||
@@ -16,6 +15,10 @@ const defaultConfig = {
|
|||||||
|
|
||||||
export default async function ({ port, directory }) {
|
export default async function ({ port, directory }) {
|
||||||
const args = process.argv
|
const args = process.argv
|
||||||
|
const argv =
|
||||||
|
process.argv.indexOf("--") !== -1
|
||||||
|
? process.argv.slice(process.argv.indexOf("--") + 1)
|
||||||
|
: []
|
||||||
args.shift()
|
args.shift()
|
||||||
args.shift()
|
args.shift()
|
||||||
args.shift()
|
args.shift()
|
||||||
@@ -55,7 +58,10 @@ export default async function ({ port, directory }) {
|
|||||||
"bin",
|
"bin",
|
||||||
"medusa.js"
|
"medusa.js"
|
||||||
)
|
)
|
||||||
let child = fork(cliPath, [`start`, ...args], { cwd: directory })
|
let child = fork(cliPath, [`start`, ...args], {
|
||||||
|
execArgv: argv,
|
||||||
|
cwd: directory,
|
||||||
|
})
|
||||||
|
|
||||||
child.on("error", function (err) {
|
child.on("error", function (err) {
|
||||||
console.log("Error ", err)
|
console.log("Error ", err)
|
||||||
@@ -79,7 +85,10 @@ export default async function ({ port, directory }) {
|
|||||||
|
|
||||||
Logger.info("Rebuilt")
|
Logger.info("Rebuilt")
|
||||||
|
|
||||||
child = fork(cliPath, [`start`, ...args], { cwd: directory })
|
child = fork(cliPath, [`start`, ...args], {
|
||||||
|
execArgv: argv,
|
||||||
|
cwd: directory,
|
||||||
|
})
|
||||||
|
|
||||||
child.on("error", function (err) {
|
child.on("error", function (err) {
|
||||||
console.log("Error ", err)
|
console.log("Error ", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user