Oh, awesome!
I lost the last commit from 3 weeks ago on https://github.com/Scirra/Construct-Addon-SDK/!
That makes a lot more sense.
Thanks!
---
Just a personal thought, about this...
Allowing developers to define their own c3runtime/main.js
file is -indeed- a great thing.
Just to try (let's not argue about if it was theoretically correct or not) I had Vite.js compile a single c3runtime/main.js
file with all my plugin logic inside it.
After all, my c3runtime/main.ts
included all the different project files, so Vite.js did what it was asked to do: it included everything in a single file.
This led me to have a single file inside my c3runtime
directory.
I edited -of course- both the addon.json
and plugin.ts
files accordingly, making sure it was the only runtime file listed inside the "file-list"
array and configured it as the main script with the SetRuntimeModuleMainScript
function.
It just didn't work.
It seems to still be looking for all the plugin-specific files (c3runtime/plugin.js
, c3runtime/types.js
, etc...), which leads to this error when the project is run.
Now... I'm pretty sure I missed something, but...
What's the point of allowing developers to define their own c3runtime/main.js
if other different files are automatically searched anyway?
---
But in the end, if you're also here looking for the solution, know that I didn't used this new c3runtime/main.js
thing.
What I was missing was simply this line inside my plugin.ts
file:
this._info.AddC3RuntimeScript("c3runtime/vendors.js");
Add this and you'll be ok!