@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
30 lines (25 loc) • 791 B
JavaScript
const peerjsString = `/* needle: fix for peerjs */ window.global = window; var parcelRequire;`
/**
* @param {import('../types').userSettings} userSettings
*/
export const needlePeerjs = (command, config, userSettings) => {
if (userSettings.noPeer === true) return;
return {
name: 'needle:peerjs',
transformIndexHtml: {
order: 'pre',
handler(html, _ctx) {
return {
html,
tags: [
{
tag: 'script',
children: peerjsString,
injectTo: 'body-prepend',
},
]
}
}
}
}
}