Skip to content

[Feature]: Configuration base for modern.server-runtime.ts #7073

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

Open
jonmean opened this issue Apr 21, 2025 · 3 comments
Open

[Feature]: Configuration base for modern.server-runtime.ts #7073

jonmean opened this issue Apr 21, 2025 · 3 comments
Assignees

Comments

@jonmean
Copy link

jonmean commented Apr 21, 2025

What problem does this feature solve?

Hello, is it possible to have a base configuration for the server file like we have for modern.config?

I would like to have basic configurations to allow override on the client, but I couldn't find any examples.

modern.config.ts

import {
  type AppTools,
  type UserConfig,
  appTools,
  mergeConfig,
} from '@modern-js/app-tools';

export const applyBaseConfig = (
  config: UserConfig<AppTools<'rspack'>> = {},
) => {
  return mergeConfig([
    {
     ...
    },
    config,
  ]);
};

modern.server-runtime.config.ts
...

What does the proposed API look like?

modern.server-runtime.config.ts

*** make server types available ***

import {
  mergeConfig,
} from '@modern-js/app-tools';

export const applyServerBaseConfig = (
  config: ServerConfig<> = {},
) => {
  return mergeConfig([
    {
     ...
    },
    config,
  ]);
};
@zllkjc
Copy link
Member

zllkjc commented Apr 21, 2025

We are currently developing something related, but I'm curious about what configuration you want to overrides in server

@jonmean
Copy link
Author

jonmean commented Apr 21, 2025

@zllkjc Cool!

Is there a release date?

My goal is to have a base file and be able to overwrite plugins in different projects... initially that will be it. I'm using some plugins that add middlewares to the server, but it depends on the project

@zllkjc
Copy link
Member

zllkjc commented Apr 27, 2025

That's great! I think this feature is exactly what you're looking for, which is to add plugins and Middleware to the service.

Due to Labor Day, we will release in the week after the holiday :)

The features is already MR #6952 , and the doc in on the way #7092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants