Using importmaps with custom Kinos #1967
-
Caveat: I very rarely use JavaScript, so I could be going completely in the wrong direction. What I'm trying to do is The example code uses a I'm back to looking at using importmaps again. I see how I can inject HTML via the To give a concrete example, in regular HTML (not in Livebook), here's what I have in the main HTML file: <script async src="https://unpkg.com/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.153.0/build/three.module.js",
"three/examples/": "https://unpkg.com/three@0.153.0/examples/",
"urdf-loader": "https://unpkg.com/urdf-loader@0.10.5/src/urdf-manipulator-element.js"
}
}
</script> Then in the main JavaScript file, I have this: import * as THREE from 'three';
import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';
import URDFManipulator from 'urdf-loader'; Could I get a hint for how to import these in a custom Kino? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @fhunleth, for integrating more packages like this you can use bundler like esbuild and it should save you the pain. We do that for the kino data_table here, note that the |
Beta Was this translation helpful? Give feedback.
Hey @fhunleth, for integrating more packages like this you can use bundler like esbuild and it should save you the pain. We do that for the kino data_table here, note that the
assets
directory is outside oflib
and building writes the bundled files intolib/assets
where you would normally write them by hand. Let me know if that works for your case :)