From b07e6880ce13a05147f6aade66625f3a9efffe00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 28 Feb 2024 13:12:07 +0100 Subject: [PATCH] Add some newlines for readability --- website/blog/2024-02-28-7.24.0.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/blog/2024-02-28-7.24.0.md b/website/blog/2024-02-28-7.24.0.md index c953be691b..e702a9ea6c 100644 --- a/website/blog/2024-02-28-7.24.0.md +++ b/website/blog/2024-02-28-7.24.0.md @@ -50,13 +50,16 @@ import myConfig from "./config.json" with { type: "json" }; Babel will transform those imports to the appropriate way of loading JSON files in your target platform(s), according to your [`targets`](https://babeljs.io/docs/options#targets) option: - Modern browsers ```js - const myConfig = await fetch(import.meta.resolve("./config.json")).then(r => r.json()); + const myConfig = await fetch(import.meta.resolve("./config.json")) + .then(r => r.json()); ``` - Older browsers without `import.meta` support - Node.js (ESM) - Node.js (CommonJS) ```js - const myConfig = JSON.parse(require("fs").readFileSync(require.resolve("./config.json"))); + const myConfig = JSON.parse( + require("fs").readFileSync(require.resolve("./config.json")) + ); ``` - Various combinations of the above