2023-03-18 19:43:07 -04:00
|
|
|
console.log("Starting the main module");
|
|
|
|
|
|
|
|
// We load the dynamic import path from the file system, to make sure any
|
|
|
|
// improvements in static analysis can't defeat the purpose of this test, which
|
|
|
|
// is to make sure the `--include` flag works to add non-analyzed imports to the
|
|
|
|
// module graph.
|
2024-07-24 20:26:54 -04:00
|
|
|
const IMPORT_PATH_FILE_PATH =
|
|
|
|
"./tests/testdata/compile/dynamic_imports/import_path";
|
2023-03-18 19:43:07 -04:00
|
|
|
|
|
|
|
setTimeout(async () => {
|
|
|
|
console.log("Dynamic importing");
|
|
|
|
const importPath = (await Deno.readTextFile(IMPORT_PATH_FILE_PATH)).trim();
|
2024-07-03 20:54:33 -04:00
|
|
|
import(import.meta.resolve(importPath)).then(() =>
|
|
|
|
console.log("Dynamic import done.")
|
|
|
|
);
|
2023-03-18 19:43:07 -04:00
|
|
|
}, 0);
|