I am playing with the 3d Christmas tree demo (3D Christmas Tree): Specifically I want to change the app so that instead of using the threejs library in/from native libraries, I’d like to import 3JS as a module, and I’d like to host the threejs module in a different anvil app.
First I created an anvil app to host the threejs files:
Hi Owen! Thanks for taking the time! ThreeJS has many other modules that can be loaded in addition to their main file (plugins/add-ons), and I have a number of apps that will be using them. I have also been writing some JS modules of my own, to be used among my apps, so I suspect I am trying to find a way to “centralize” things.
If you prefer local files, you could use your centralised app as a dependency then you don’t need to import from the published url of the centralised app. Theme assets are merged with dependency assets and accessible in the same way. Put your assets in a folder in the centralised app and then import from "./_/theme/<my-folder>/<my-file>.js".