feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)
Co-authored-by: Rares Stefan <948623+StephixOne@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
26c78bbc03
commit
f1a05f4725
32
packages/admin/src/commands/develop.ts
Normal file
32
packages/admin/src/commands/develop.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { AdminOptions, develop as adminDevelop } from "@medusajs/admin-ui"
|
||||
import { getPluginPaths, loadConfig } from "../utils"
|
||||
|
||||
type DevelopArgs = AdminOptions & {
|
||||
port: number
|
||||
}
|
||||
|
||||
export default async function develop({ backend, path, port }: DevelopArgs) {
|
||||
const config = loadConfig(true)
|
||||
|
||||
if (!config) {
|
||||
// @medusajs/admin is not part of the projects plugins
|
||||
// so we return early
|
||||
return
|
||||
}
|
||||
|
||||
const plugins = await getPluginPaths()
|
||||
|
||||
await adminDevelop({
|
||||
appDir: process.cwd(),
|
||||
buildDir: config.outDir,
|
||||
plugins,
|
||||
options: {
|
||||
backend: backend || config.backend,
|
||||
path: path || config.path,
|
||||
develop: {
|
||||
port: port || config.develop.port,
|
||||
open: config.develop.open,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user