How to add a Global Default Script?

I think these are missing features, as I don’t see them in the GDevelop wiki. For example, including NPM dependencies, I could have this default script:

import { someFn } from 'com.foo.scientific';

Thus any scene script may refer to someFn:

(runtimeScene => {
})();

Besides being able to have a default script, it’s also good for newly-created projects to auto integrate ECMAScript transpilation tools such as Rollup.

Not sure if it’s very useful for the front-end though…

A “global default script” already exists as the onFirstSceneLoaded lifetime function in extensions. You usually can paste the bundled code of a library into a JS event in that lifetime function to have it loaded in.

Well we leave to you the liberty to chose your toolchain. If you want to bundle or use any tooling on the exported js files, you are welcome to do so. I don’t think forcing tooling onto people is a good idea. I hope in the future to add plugins to my gdexport project (a cli exporter for GDevelop games) to help streamline the process of building your own toolchain.

2 Likes