Modern.js supports import JSON files in code, and also supports import YAML and Toml files and converting them to JSON format.
You can import JSON files directly in JavaScript files.
Modern.js does not support importing JSON files via named import yet:
YAML is a data serialization language commonly used for writing configuration files.
You can directly import .yaml
or .yml
files in JavaScript and they will be automatically converted to JSON format.
When you import a YAML file in your TypeScript code, please create a src/global.d.ts
file in your project and add the corresponding type declaration:
Toml is a semantically explicit, easy-to-read configuration file format.
You can directly import .toml
files in JavaScript and it will be automatically converted to JSON format.
When you import Toml files in TypeScript code, please create a src/global.d.ts
file in your project and add the corresponding type declarations: