-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update admin build/serve configuration #9584
chore: Update admin build/serve configuration #9584
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…thub.com:medusajs/medusa into chore/change-admin-serve-and-build-configuration
This case kind of doesn't make sense, you would never want to run the build command with --admin-only if you haven't disabled it as well, because in that case you end up with two admins. I think its fine to keep the functionality, as it is the correct behaviour for case 3, but maybe it would make sense to log a warning like: "You are building the admin dashboard for standalone usage, but have not disabled the dashboard from being served along with your server. If you intend to host the dashboard separatly you should disable the admin in your medusa config". |
just added a warning as suggested 👍 |
@@ -0,0 +1,3 @@ | |||
export const ADMIN_SOURCE_DIR = "src/admin" | |||
export const ADMIN_RELATIVE_OUTPUT_DIR = "./public/admin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: isn't the public folder typically associated with something else than build artefacts? maybe we can do ./dist/admin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont have a strong opinion on this, the thinking was that it is served through express middleware and in general the files you serve through a middleware are often located in a public directory. But fine to move it to dist if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, let's keep it as is
Breaking changes
The
outDir
has been deprecated and wont be used anymore, instead all the path are computed internally following these rulesdisabled
and thebuild
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.disabled
and thebuild
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.disabled
and thebuild
command is run with the--admin-only
flag, then fallback to rule number 2.medusa/admin
.medusa/server/public/admin
.medusa/admin
// medusa-config.ts { // ... admin: { - outDir: 'some/path' } }
cc @kasperkristensen @sradevski @olivermrbl