chore: Update admin build/serve configuration (#9584)
**Breaking changes** The `outDir` has been deprecated and wont be used anymore, instead all the path are computed internally following these rules - if admin is not `disabled` and the `build` command is run without the `--admin-only` flag, then the admin output dir will be `.medusa/server/public/admin` and it will be served from that same location from the medusa instance. - if admin is not `disabled` and the `build` command is run with the `--admin-only` flag, then the admin output dir will be `.medusa/admin` with the purpose of deploying the admin separately. ⚠️ (expect to receive a warning log) - if the admin is `disabled` and the `build` command is run with the `--admin-only` flag, then fallback to rule number 2 | admin enabled | medusa build --admin-only | output dir | |---|---|---| | true | true | `.medusa/admin` ⚠️ (expect to receive a warning log) | | true | false | `.medusa/server/public/admin` | | false | true | `.medusa/admin` | | false | false | none | ```diff // medusa-config.ts { // ... admin: { - outDir: 'some/path' } } ``` cc @kasperkristensen @sradevski @olivermrbl
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export const ADMIN_SOURCE_DIR = "src/admin"
|
||||
export const ADMIN_RELATIVE_OUTPUT_DIR = "./public/admin"
|
||||
export const ADMIN_ONLY_OUTPUT_DIR = ".medusa/admin"
|
||||
@@ -2,3 +2,4 @@ export * from "./clean-response-data"
|
||||
export * from "./exception-formatter"
|
||||
export * from "./middlewares"
|
||||
export * from "./define-middlewares"
|
||||
export * from "./admin-consts"
|
||||
|
||||
Reference in New Issue
Block a user