spoint 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/app.js CHANGED
@@ -659,7 +659,7 @@ scene.add(ground)
659
659
 
660
660
  const gltfLoader = new GLTFLoader()
661
661
  const dracoLoader = new DRACOLoader()
662
- dracoLoader.setDecoderPath('https://esm.sh/v135/three@0.171.0/examples/jsm/libs/draco/')
662
+ dracoLoader.setDecoderPath('/draco/')
663
663
  gltfLoader.setDRACOLoader(dracoLoader)
664
664
  gltfLoader.register((parser) => new VRMLoaderPlugin(parser))
665
665
  const playerMeshes = new Map()
@@ -813,7 +813,9 @@ function removePlayerMesh(id) {
813
813
 
814
814
  function evaluateAppModule(code) {
815
815
  try {
816
- const stripped = code.replace(/^import\s+.*$/gm, '')
816
+ // Strip imports and import.meta usage
817
+ let stripped = code.replace(/^import\s+.*$/gm, '')
818
+ stripped = stripped.replace(/const\s+__dirname\s*=.*import\.meta\.url.*$/gm, 'const __dirname = "/"')
817
819
  const wrapped = stripped.replace(/export\s+default\s*/, 'return ').replace(/export\s+/g, '')
818
820
  return new Function(wrapped)()
819
821
  } catch (e) { console.error('[app-eval]', e.message, e.stack); return null }