@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.
33 lines (29 loc) • 1.27 kB
JavaScript
/**
* @param {import('../types').userSettings} userSettings
* @returns {import('vite').Plugin[]}
*/
export const needleTransformCode = (command, config, userSettings) => {
return [
{
name: 'needle-transform-code',
/**
* @param {string} src
* @param {string} id
*/
transform(src, id) {
if (id.includes("three__quarks.js") || id.includes("three.quarks")) {
const line1 = `console.log('%c Particle system powered by three.quarks. https://quarks.art/', 'font-size: 14px; font-weight: bold;');`
const line2 = `console.log("%c Particle system powered by three.quarks. https://quarks.art/", "font-size: 14px; font-weight: bold;");`;
const replacement = `setTimeout(()=> console.debug("Particle system powered by three.quarks. https://quarks.art/"), 100);`
const content = src
.replace(line1, replacement)
.replace(line2, replacement);
return {
code: content,
map: null
}
}
},
}
];
}