support JSON modules in qjsc - added support of JSON5 modules (using type = "json5")

This commit is contained in:
Fabrice Bellard
2025-05-24 10:24:01 +02:00
parent 1dfaa61680
commit 7c487f1c6a
7 changed files with 149 additions and 44 deletions

View File

@@ -1,6 +1,8 @@
/* example of JS module */
/* example of JS and JSON modules */
import { fib } from "./fib_module.js";
import msg from "./message.json";
console.log("Hello World");
console.log("fib(10)=", fib(10));
console.log("msg=", msg);

2
examples/message.json Normal file
View File

@@ -0,0 +1,2 @@
{ "x" : 1, "tab": [ 1, 2, 3 ] }