Skip to content

Commit 4354b58

Browse files
authored
feat(json)!: add json.stringify: 'auto' and make that the default (#1651)
1 parent edfc6c7 commit 4354b58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/shared-options.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ Lightning CSS の設定。すべての変換オプションは [Lightning CSS
345345

346346
## json.stringify
347347

348-
- **型:** `boolean`
349-
- **デフォルト:** `false`
348+
- **型:** `boolean | 'auto'`
349+
- **デフォルト:** `'auto'`
350350

351351
`true` に設定すると、インポートされた JSON は `export default JSON.parse("...")` に変換されます。これは特に JSON ファイルが大きい場合、オブジェクトリテラルよりも大幅にパフォーマンスが向上します。
352352

353-
有効にすると、名前付きインポートは無効になります
353+
`'auto'` に設定すると、[データが 10kB より大きい](https://v8.dev/blog/cost-of-javascript-2019#json:~:text=A%20good%20rule%20of%20thumb%20is%20to%20apply%20this%20technique%20for%20objects%20of%2010%20kB%20or%20larger) 場合にのみデータが文字列化されます
354354

355355
## esbuild
356356

0 commit comments

Comments
 (0)