Skip to content

Commit

Permalink
chore(server): add compiler option for createDevServer
Browse files Browse the repository at this point in the history
  • Loading branch information
await-ovo committed Sep 27, 2024
1 parent 279af34 commit cfd3bf5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-trains-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-js/server': patch
---

chore(server): add compiler option for createDevServer
1 change: 1 addition & 0 deletions packages/server/server/src/createDevServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export async function createDevServer(

const builderDevServer = await builder?.createDevServer({
runCompile: options.runCompile,
compiler: options.compilier,
});

server.addPlugins([
Expand Down
7 changes: 6 additions & 1 deletion packages/server/server/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DevServerHttpsOptions, DevServerOptions } from '@modern-js/types';
import type { UniBuilderInstance } from '@modern-js/uni-builder';
import type { Rspack, UniBuilderInstance } from '@modern-js/uni-builder';

import type {
NodeServer,
Expand All @@ -17,6 +17,11 @@ export type ExtraOptions = {

runCompile?: boolean;

/**
* The existing compiler can be used here.
*/
compilier?: Rspack.Compiler | Rspack.MultiCompiler;

/** compat, the default value is modern.server-runtime.config.ts */
serverConfigFile?: string;

Expand Down

0 comments on commit cfd3bf5

Please sign in to comment.