David Herman
10/13/2022, 10:42 PMper-module
instead of whole-program
.
I know I can just change the granularity back, but before I do that, I'm trying to, in code, generate an index.html
file will all the separate JS files imported via <script>
tags. The problem is, I don't know the order to import them. Is there a way to find out?kotlin-kotlin-stdlib-js-ir.js
and example-site.js
.
I assume I want to declare them like so:
<script src="kotlin-kotlin...js"></script>
<script src="example-site.js"></script>
hfhbd
10/14/2022, 3:40 AMwhole-program
option), doesn't it?David Herman
10/14/2022, 3:42 AMhfhbd
10/14/2022, 4:00 AMif (typeof this['web-internal-web-core-runtime'] === 'undefined') {
throw new Error("Error loading module 'routing-compose-browserRouterTest'. Its dependency 'web-internal-web-core-runtime' was not found. Please, check whether 'web-internal-web-core-runtime' is loaded prior to 'routing-compose-browserRouterTest'.");
}
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
throw new Error("Error loading module 'routing-compose-browserRouterTest'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'routing-compose-browserRouterTest'.");
}
if (typeof this['androidx-runtime'] === 'undefined') {
throw new Error("Error loading module 'routing-compose-browserRouterTest'. Its dependency 'androidx-runtime' was not found. Please, check whether 'androidx-runtime' is loaded prior to 'routing-compose-browserRouterTest'.");
}
if (typeof this['routing-compose-integrationTest'] === 'undefined') {
throw new Error("Error loading module 'routing-compose-browserRouterTest'. Its dependency 'routing-compose-integrationTest' was not found. Please, check whether 'routing-compose-integrationTest' is loaded prior to 'routing-compose-browserRouterTest'.");
}
if (typeof this['routing-compose'] === 'undefined') {
throw new Error("Error loading module 'routing-compose-browserRouterTest'. Its dependency 'routing-compose' was not found. Please, check whether 'routing-compose' is loaded prior to 'routing-compose-browserRouterTest'.");
}
For example, every Kotlin lib depends on the stdlib, which is not the first.<script src="kotlin-kotlin...js" async></script>
, so how does JS enforce the order? 🤔David Herman
10/14/2022, 4:03 AMhfhbd
10/14/2022, 4:06 AMweb-internal-web-core-runtime
depends on androidx-runtime
which itself depends on kotlin-kotlin-stdlib-js-ir
. Yeah, every dependency has to be loaded before running the actual code, but the order of the imports does not matter, I guess. Otherwise it would not work 😄David Herman
10/14/2022, 5:33 AM