File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- import TOML from "@iarna/toml" ;
2
- import yaml from "js-yaml" ;
3
- import JSON5 from "json5" ;
4
1
import fs from "node:fs" ;
5
2
import path from "node:path" ;
6
3
import JSONC from "tiny-jsonc" ;
@@ -33,6 +30,7 @@ const Loaders = {
33
30
} ,
34
31
json5 : async ( filePath : string ) : Promise < unknown > => {
35
32
const fileContent = fs . readFileSync ( filePath , "utf8" ) ;
33
+ const JSON5 = ( await import ( "json5" ) ) . default ;
36
34
const config = JSON5 . parse ( fileContent ) ;
37
35
return config ;
38
36
} ,
@@ -53,9 +51,11 @@ const Loaders = {
53
51
} ,
54
52
toml : async ( filePath : string ) : Promise < unknown > => {
55
53
const fileContent = fs . readFileSync ( filePath , "utf8" ) ;
54
+ const TOML = ( await import ( "@iarna/toml" ) ) . default ;
56
55
return TOML . parse ( fileContent ) ;
57
56
} ,
58
57
yaml : async ( filePath : string ) : Promise < unknown > => {
58
+ const yaml = ( await import ( "js-yaml" ) ) . default ;
59
59
const fileContent = fs . readFileSync ( filePath , "utf8" ) ;
60
60
return yaml . load ( fileContent , {
61
61
schema : yaml . JSON_SCHEMA ,
You can’t perform that action at this time.
0 commit comments