Skip to content

Commit 0a54d6b

Browse files
committed
🔥 fix dev | prod mode
1 parent 4d12096 commit 0a54d6b

File tree

11 files changed

+765
-139
lines changed

11 files changed

+765
-139
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "@antfu"
2+
"extends": "@antfu",
3+
"rules": {
4+
"import/no-mutable-exports": "off"
5+
}
36
}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ export function App() {
6565
}
6666
```
6767

68+
## Dev | Prod
69+
Due to the compiled code of react in `dev` mode is different of `prod` mode, so before build your app, please set the mode to `prod`
70+
71+
```ts
72+
Components({
73+
mode: 'prod' // deafult: dev
74+
})
75+
```
76+
6877
## TypeScript
6978
```ts
7079
Components({

playground/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function App() {
44
return (
55
<div className="App">
66
<Button variant={'contained'}>hi mui</Button>
7+
<Box />
78
<AntProgress percent={30} />
89
<AntProgress percent={30} />
910

playground/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ export default defineConfig({
1111
Components({
1212
dts: true,
1313
local: true,
14+
mode: 'prod',
1415
resolvers: [
1516
MuiResolver({
1617
prefix: false,
1718
}),
18-
AntdResolver(),
19+
AntdResolver({
20+
prefix: 'Ant',
21+
}),
1922
],
2023
}),
2124
Inspect(),

0 commit comments

Comments
 (0)