I have two very basic Node projects. Project A
imports and call a simple function from project B
. and renders it with WebGPURenderer.
//Project B
import * as THREE from 'three/tsl';
export const createPlane = () => {
const mesh = new THREE.Mesh(new THREE.PlaneGeometry(),new THREE.MeshBasicNodeMaterial())
mesh.frustumCulled =false
return mesh
}
//------------
//Project A
import * as foo from '@B/core'
...
scene.add(foo.createPlane())
But calling my function from project A cause this error:
While this works, I don’t intend to write my library this way:
//Project B
import * as THREE from 'three/tsl';
export const createPlane = ({material}) => {
const mesh = new THREE.Mesh(new THREE.PlaneGeometry(),material)
mesh.frustumCulled =false
return mesh
}
//------------
//Project A
import * as THREE from 'three/tsl';
import * as foo from '@B/core'
...
scene.add(foo.createPlane({material:new THREE.MeshBasicNodeMaterial()}))