Custom JS for ui-template in Dashboard 2.0

The documentation of ui template has an example of external JS:

<script src="https://cdn.babylonjs.com/babylon.js"></script>

I would like to include a local file resource, so I modified settings.js to include

module.exports = {
  httpStatic: '/opt/robotapp/static/',
  httpStaticRoot: '/static/',
}

Then I can use:

<script src="/static/test.js"></script>

Two questions:

  • Is this the right approach or is there a better way?
  • When using ES6 syntax I need to use type=module in the script tag?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.