Skip to content

Commit 634a06a

Browse files
committed
fix: format && config error
1 parent 12ad541 commit 634a06a

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

apps/modernjs/modern.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { appTools, defineConfig } from '@modern-js/app-tools';
22
import { ModuleFederationPlugin } from '@module-federation/enhanced';
33
// https://modernjs.dev/en/configure/app/usage
44
export default defineConfig({
5-
dev: {
5+
server: {
66
port: 4001,
77
},
88
runtime: {

apps/modernjs/src/components/react-component.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { usePrefetch } from '@module-federation/enhanced/prefetch';
33
import { Await } from '@modern-js/runtime/router';
44

55
interface UserInfo {
6-
id: number;
7-
title: string;
6+
data: {
7+
id: number;
8+
title: string;
9+
};
810
}
911
const reFetchParams = {
1012
data: {

packages/chrome-devtools/modern.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default defineConfig({
1010
},
1111
output: {
1212
disableInlineRuntimeChunk: true,
13-
disableFilenameHash: true,
14-
disableMinimize: true,
13+
filenameHash: true,
14+
minify: false,
1515
},
1616
performance: {
1717
chunkSplit: {

packages/modernjs/src/cli/configPlugin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import type { BundlerChainConfig } from '../interfaces/bundler';
2222

2323
const defaultPath = path.resolve(process.cwd(), 'module-federation.config.ts');
2424

25-
export type ConfigType<T> = T extends 'rspack'
26-
? Rspack.Configuration
27-
: never;
25+
export type ConfigType<T> = T extends 'rspack' ? Rspack.Configuration : never;
2826

2927
type RuntimePluginEntry = NonNullable<
3028
moduleFederationPlugin.ModuleFederationPluginOptions['runtimePlugins']
@@ -346,8 +344,7 @@ export function patchBundlerConfig(options: {
346344

347345
if (isDev() && chain.output.get('publicPath') === 'auto') {
348346
// TODO: only in dev temp
349-
const port =
350-
modernjsConfig.server?.port || 8080;
347+
const port = modernjsConfig.server?.port || 8080;
351348
const publicPath = `http://localhost:${port}/`;
352349
chain.output.publicPath(publicPath);
353350
}

packages/modernjs/src/cli/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os from 'os';
22
import type { Rspack } from '@modern-js/app-tools';
33

4-
export type ConfigType = Rspack.Configuration
4+
export type ConfigType = Rspack.Configuration;
55

66
const localIpv4 = '127.0.0.1';
77

packages/modernjs/src/interfaces/bundler.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ type ExtractObjectType<T> = T extends (...args: any[]) => any ? never : T;
99
type OmitArrayConfiguration<T> =
1010
T extends Array<any> ? (T extends (infer U)[] ? U : T) : ExtractObjectType<T>;
1111

12-
1312
type RspackConfigs =
14-
ExcludeUndefined<AppToolsUserConfig> extends { rspack?: infer U }
15-
? U
16-
: never;
13+
ExcludeUndefined<AppToolsUserConfig> extends { rspack?: infer U } ? U : never;
1714
type ObjectRspack = ExtractObjectType<OmitArrayConfiguration<RspackConfigs>>;
1815

1916
type BundlerChain = ExcludeUndefined<

packages/rsbuild-plugin/src/utils/ssr.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { createRequire } from 'node:module';
33
import { encodeName } from '@module-federation/sdk';
44
import { CALL_NAME_MAP } from '../constant';
55

6-
import type { DistPathConfig, EnvironmentConfig, RsbuildConfig, Rspack } from '@rsbuild/core';
6+
import type {
7+
DistPathConfig,
8+
EnvironmentConfig,
9+
RsbuildConfig,
10+
Rspack,
11+
} from '@rsbuild/core';
712
import type { moduleFederationPlugin } from '@module-federation/sdk';
813

914
const require = createRequire(import.meta.url);

0 commit comments

Comments
 (0)