Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 14, 2025. It is now read-only.

Commit 4ecc84e

Browse files
committed
feat(webpack): stop using jiti because node 20 is compatible with rquire(esm)
1 parent 9c24248 commit 4ecc84e

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

packages/unplugin-typia/README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,10 @@ Examples:
191191
<details>
192192
<summary>Webpack</summary><br>
193193

194-
> ⚠️ Note: Currently, this plugin works only with 'esm' target.
195-
196-
> If you want to use 'cjs' target on Node < 20.17.0 , please use with [`jiti`](https://github.com/unjs/jiti).
197-
> If you want to use 'cjs' target on Node >= 20.17.0, please use with `require` and enable [`--experimental-require-modules` flag](https://github.com/nodejs/node/pull/51977).
198-
> If you want to use 'esm' target, don't worry! You can use this plugin without any additional setup.
199-
200-
```sh
201-
npm install jiti
202-
```
203-
204194
```js
205195
// webpack.config.js
206196

207-
// if you use Node < 20.17.0
208-
const jiti = require('jiti')(__filename);
209-
const { default: UnpluginTypia } = jiti('@ryoppippi/unplugin-typia/webpack');
210-
211-
// if you use Node >= 20.17.0
212-
// const { default: UnpluginTypia } = require("@ryoppippi/unplugin-typia/webpack");
197+
const { default: UnpluginTypia } = require('@ryoppippi/unplugin-typia/webpack');
213198

214199
module.exports = {
215200
plugins: [

packages/unplugin-typia/src/webpack.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,10 @@ import unplugin from './core/index.js';
99
/**
1010
* Webpack plugin
1111
*
12-
* Currently, this plugin works only with 'esm' target.
13-
*
14-
* If you want to use 'cjs' target on Node < 20.17.0 , please use with [`jiti`](https://github.com/unjs/jiti).
15-
* If you want to use 'cjs' target on Node >= 20.17.0, please use with `require` and enable [`--experimental-require-modules` flag](https://github.com/nodejs/node/pull/51977).
16-
* If you want to use 'esm' target, don't worry! You can use this plugin without any additional setup.
17-
*
18-
* Refer this issue https://github.com/samchon/typia/issues/1094
19-
*
2012
* @example
2113
* ```js
2214
* // webpack.config.js
2315
*
24-
* // if you use Node < 20.17.0
25-
* const jiti = require("jiti")(__filename);
26-
* const { default: UnpluginTypia } = jiti("@ryoppippi/unplugin-typia/webpack");
27-
*
28-
* // if you use Node >= 20.17.0
2916
* const { default: UnpluginTypia } = require("@ryoppippi/unplugin-typia/webpack");
3017
*
3118
* module.exports = {

0 commit comments

Comments
 (0)