Skip to content
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

fix(admin): loadConfig does not allow serve to be truly configurable #11238

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stale-ghosts-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/admin": patch
---

fix(admin): loadConfig does not allow serve to be truly configurable
3 changes: 1 addition & 2 deletions packages/admin/src/utils/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const loadConfig = (isDev?: boolean): PluginOptions | null => {
if (isDev) {
config = {
...config,
serve: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We remove the forced false value here to make sure it's configurable as explained in the docs

path: "/",
backend: "http://localhost:9000",
}
Expand All @@ -45,7 +44,7 @@ export const loadConfig = (isDev?: boolean): PluginOptions | null => {
const options = (plugin as { options: PluginOptions }).options ?? {}

config = {
serve: isDev ? false : options.serve ?? config.serve,
serve: options.serve ?? config.serve,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same goes here, to make sure it's fully configurable

autoRebuild: options.autoRebuild ?? config.autoRebuild,
path: options.path ?? config.path,
outDir: options.outDir ?? config.outDir,
Expand Down