Skip to content

Commit 42692a9

Browse files
authored
Merge pull request #97 from ryoppippi/feature/fix-bun-docs
feat(README): add limitation note for Bun.runtime usage
2 parents e4128dd + 7994a43 commit 42692a9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/unplugin-typia/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ Check the [Plugins – Bundler | Bun Docs](https://bun.sh/docs/bundler/plugins)
138138

139139
### Example 2: Using for running script
140140

141+
> ⚠️ Limitation: you need import `typia` module as default import in your script.
142+
> Type named import is fine
143+
>
144+
> ```ts
145+
> import type { tag } from 'typia'; // do
146+
> import typia from 'typia'; // do
147+
> ```
148+
>
149+
> ```ts
150+
> import { createIs } from 'typia'; // don't
151+
> ```
152+
>
153+
> This is due to `Bun`'s bug. See [this issue](https://github.com/ryoppippi/unplugin-typia/issues/44)
154+
141155
```ts
142156
// preload.ts
143157
import { plugin } from 'bun';

packages/unplugin-typia/src/bun.ts

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ async function resolveTypiaPath(id: string, code: string, options: ResolvedBunOp
126126
* $ bun run ./index.ts
127127
* ```
128128
*
129+
* When you run your scripts on Bun.runtime, You cannot use named import for typia value in the source code. Check out the README.md.
129130
*/
130131
function bunTypiaPlugin(
131132
options?: BunOptions,

0 commit comments

Comments
 (0)