import_dynamic
A module uses dynamic `import()`.
A module uses dynamic import().
| Kind | Build or validation problem |
| Reported by | Archive and source validation |
disko exit code | 1 (problems) |
A module calls import() to load another module at run time. Only static
import and export … from declarations are allowed, so the complete module
graph is known when the game is published.
Why it happens
Dynamic import() is often used to load a level or mode on demand. In disko
every module is packaged and loaded up front, so a static import does the same
job.
Wrong
src/main.js
Right
src/main.js
To choose between modes at run time, import all of them statically and pick one in code.