fix(medusa): Resolve babel executable with npx (#5952)

This commit is contained in:
Oli Juhl
2024-01-02 10:13:54 +01:00
committed by GitHub
parent c8f03e3a47
commit 487067fb48
2 changed files with 7 additions and 9 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
feat(medusa): Resolve babel executable with npx

View File

@@ -43,14 +43,7 @@ export default async function ({ port, directory }) {
process.exit(0)
})
const babelPath = path.resolve(
require.resolve("@babel/cli"),
"../",
"bin",
"babel.js"
)
execSync(`"${babelPath}" src -d dist --ignore "src/admin/**"`, {
execSync(`npx --no-install babel src -d dist --ignore "src/admin/**"`, {
cwd: directory,
stdio: ["ignore", process.stdout, process.stderr],
})
@@ -112,7 +105,7 @@ export default async function ({ port, directory }) {
child.kill("SIGINT")
execSync(
`${babelPath} src -d dist --extensions ".ts,.js" --ignore "src/admin/**"`,
`npx --no-install babel src -d dist --extensions ".ts,.js" --ignore "src/admin/**"`,
{
cwd: directory,
stdio: ["pipe", process.stdout, process.stderr],