Skip to content

Commit

Permalink
chore: code format (#11837)
Browse files Browse the repository at this point in the history
  • Loading branch information
fz6m authored Nov 6, 2023
1 parent 4a93ea2 commit 56313d4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
1 change: 0 additions & 1 deletion examples/with-stylus/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import './index.styl';
import styles from './index.styl';

Expand Down
4 changes: 2 additions & 2 deletions packages/bundler-utils/src/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ProxyOptions } from './types';
import assert from 'assert';
import type { Express } from '../compiled/express';
import { createProxyMiddleware } from '../compiled/http-proxy-middleware';
import assert from 'assert';
import type { ProxyOptions } from './types';

export function createProxy(
proxy: { [key: string]: ProxyOptions } | ProxyOptions[],
Expand Down
6 changes: 1 addition & 5 deletions packages/bundler-webpack/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ export function getSchemas(): Record<string, (arg: { zod: typeof z }) => any> {
runtimePublicPath: ({ zod }) => zod.object({}),
sassLoader: ({ zod }) => zod.record(zod.string(), zod.any()),
srcTranspiler: ({ zod }) =>
zod.enum([
Transpiler.babel,
Transpiler.esbuild,
Transpiler.swc,
]),
zod.enum([Transpiler.babel, Transpiler.esbuild, Transpiler.swc]),
srcTranspilerOptions: ({ zod }) =>
zod
.object({
Expand Down
7 changes: 4 additions & 3 deletions packages/plugins/src/mf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ export default function mf(api: IApi) {
);
}

const useHash = typeof api.config.mf.remoteHash === 'boolean'
? api.config.mf.remoteHash
: (api.config.hash && api.env !== 'development');
const useHash =
typeof api.config.mf.remoteHash === 'boolean'
? api.config.mf.remoteHash
: api.config.hash && api.env !== 'development';

const mfConfig = {
name,
Expand Down
5 changes: 4 additions & 1 deletion packages/plugins/src/qiankun/slave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export interface IRuntimeConfig {
// 默认不修改 library chunk 的 name,从而确保可以通过 window[appName] 访问到导出
// mfsu 关闭的时候才可以修改,否则可能导致配合 mfsu 时,子应用的 umd chunk 无法被正确加载
// mfsu 线上不会开启,所以这里只需要判断本地是否开启即可
const { shouldNotAddLibraryChunkName = api.env === 'production' || !Boolean(api.config.mfsu) } = (api.config.qiankun || {}).slave!;
const {
shouldNotAddLibraryChunkName = api.env === 'production' ||
!Boolean(api.config.mfsu),
} = (api.config.qiankun || {}).slave!;
config.output
.libraryTarget('umd')
.library(
Expand Down
22 changes: 12 additions & 10 deletions packages/renderer-react/src/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ export async function getClientRootComponent(opts: {
</AppContext.Provider>
);
if (opts.withoutHTML) {
return <>
<div id="root">{app}</div>
<script
dangerouslySetInnerHTML={{
__html: `window.__UMI_LOADER_DATA__ = ${JSON.stringify(
opts.loaderData,
)}`,
}}
/>
</>;
return (
<>
<div id="root">{app}</div>
<script
dangerouslySetInnerHTML={{
__html: `window.__UMI_LOADER_DATA__ = ${JSON.stringify(
opts.loaderData,
)}`,
}}
/>
</>
);
}
return (
<Html loaderData={opts.loaderData} manifest={opts.manifest}>
Expand Down

0 comments on commit 56313d4

Please sign in to comment.