chore: lazy import admin-bundler and run scripts during publish (#10996)

This commit is contained in:
Harminder Virk authored and GitHub committed 2025-01-16 20:28:17 +05:30
1 parent 9a742911fe
commit 114b2133aa
3 files changed
+8 -5

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
chore: lazy import admin-bundler and run scripts during publish
+2 -4
View File
@@ -1,4 +1,3 @@
import { plugin } from "@medusajs/admin-bundler"
import { Compiler } from "@medusajs/framework/build-tools" import { Compiler } from "@medusajs/framework/build-tools"
import { logger } from "@medusajs/framework/logger" import { logger } from "@medusajs/framework/logger"
export default async function build({ export default async function build({
@@ -15,9 +14,8 @@ export default async function build({
return false return false
} }
const bundler = await import("@medusajs/admin-bundler")
await compiler.buildPluginBackend(tsConfig) await compiler.buildPluginBackend(tsConfig)
await compiler.buildPluginAdminExtensions({ await compiler.buildPluginAdminExtensions(bundler)
plugin,
})
return true return true
} }
@@ -9,9 +9,9 @@ export default async function localPublishPlugin({
directory: string directory: string
}) { }) {
await yalc.publishPackage({ await yalc.publishPackage({
push: true,
workingDir: directory, workingDir: directory,
changed: true, changed: true,
replace: true, replace: true,
scripts: true,
}) })
} }