Install Node.js, NPM is usually installed with it.
Create a Project
In the root of your Wonderland Engine project, run the following command:
You will be prompted to fill in some additional information, the defaults often
This will have created a package.json file, which we will edit in the following
Set up bundling
As we are going to take care of bundling ourselves now, we need to install a bundler
using the npm package manager.
Because it matches the rapid iteration workflow of Wonderland Engine well, we suggest
npm i --save-dev esbuild
The bundler will start at an “entrypoint” and recursively parse and include other files.
We will therefore need to create an entrypoint for our bundle: we call it bundle.js and
save it into a js folder in our project.
Replace <PROJECT> with the name you set for your Wonderland Engine project in the project settings.
Switch to NPM Bundling
Go to Views > Project Settings > Java Script and switch from “default bundler” to “npm script”.
You can leave the npmScript setting at default, “build” corresponds to the script we created in our
Instead of automatically bundling everything, we are now required to explicitly select which scripts we want to include.
To include local scripts, you can add lines like these to your bundle.js:
To include editor default components, install the components first:
npm i --save @wonderlandengine/components
Then add lines like the following to your bundle.js: