Skip to content

Commit

Permalink
fix(medusa): Resolve babel executable with npx (#5952)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivermrbl authored Jan 2, 2024
1 parent c8f03e3 commit 487067f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-otters-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

feat(medusa): Resolve babel executable with npx
11 changes: 2 additions & 9 deletions packages/medusa/src/commands/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
})
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 487067f

Please sign in to comment.