How to js import into other scripts

In Javascript I am able to:

// helper.js
export const convert = function(data){
    // function logic
// some other file.js
import {convert} from '../helper.js'

Am I able to do this in Playcanvas?

The Editor workflow doesn’t support imports and relies on expose classes/variables/functions globally.

It effectively just adds all the JS files to the HTML page with <script> tags in the loading order defined here: Loading Order | Learn PlayCanvas

1 Like