Skip to content

Commit 0154e3c

Browse files
committed
🎉 release v0.1.1
1 parent b45c873 commit 0154e3c

File tree

5 files changed

+66
-17
lines changed

5 files changed

+66
-17
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ logs
66
npm-debug.log*
77
yarn-debug.log*
88
yarn-error.log*
9-
9+
.vite-inspect
1010
# Runtime data
1111
pids
1212
*.pid

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ 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-
7768
## TypeScript
7869
```ts
7970
Components({

playground/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@vitejs/plugin-react": "^2.1.0",
2121
"typescript": "^4.6.4",
2222
"unplugin-react-components": "workspace:*",
23-
"vite": "^3.1.0"
23+
"vite": "^3.1.0",
24+
"vite-plugin-inspector": "^1.0.4"
2425
}
2526
}

pnpm-lock.yaml

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createUnplugin } from 'unplugin'
22
import MagicString from 'magic-string'
33
import { createFilter } from '@rollup/pluginutils'
44
import type { GenerateDtsOptions, Options, TransformOptions } from './types'
5-
import { changeREOnBuildStart, transform } from './core/transformer'
5+
import { transform } from './core/transformer'
66
import { searchGlob } from './core/searchGlob'
77
import { generateDts } from './core/generateDts'
88
import { resolveOptions } from './core/utils'
@@ -46,15 +46,10 @@ export default createUnplugin<Options>((options = {}) => {
4646
rootDir: options.rootDir!,
4747
resolvers: options.resolvers!,
4848
local: options.local!,
49-
mode: options.mode!,
5049
id,
5150
}
5251

5352
return await transform(context)
5453
},
55-
buildStart() {
56-
if (options.mode === 'prod')
57-
changeREOnBuildStart()
58-
},
5954
}
6055
})

0 commit comments

Comments
 (0)