diff --git a/packages/engine/package.json b/packages/engine/package.json index 36701648..cc0d6d81 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -29,7 +29,6 @@ }, "dependencies": { "lodash.debounce": "^4.0.8", - "three-stdlib": "^2.34.0", "uid": "^2.0.2", "zustand": "^5.0.2" } diff --git a/packages/engine/src/globalVars.ts b/packages/engine/src/globalVars.ts index 659c639d..e5546092 100644 --- a/packages/engine/src/globalVars.ts +++ b/packages/engine/src/globalVars.ts @@ -1,5 +1,4 @@ import * as THREE from 'three' -import * as THREE_EXTRAS from 'three-stdlib' import * as postprocessing from 'postprocessing' // Third party dependencies exposed globally for sketch development // Needs to also be exported so can be used by type definition files @@ -8,18 +7,9 @@ export const dependencies = { // This keeps the library versions matched and also prevents strange things from happening when the library // code is being read from different sources THREE, - THREE_EXTRAS, postprocessing, } -// declare global { -// interface Window { -// HEDRON: { -// dependencies: typeof dependencies -// } -// } -// } - // @ts-expect-error --- window.HEDRON = { dependencies, diff --git a/packages/example-project/global.d.ts b/packages/example-project/global.d.ts index 3fc88e19..da94a532 100644 --- a/packages/example-project/global.d.ts +++ b/packages/example-project/global.d.ts @@ -3,7 +3,6 @@ declare global { HEDRON: { dependencies: { THREE: typeof import('three') - THREE_EXTRAS: typeof import('three-stdlib') postprocessing: typeof import('postprocessing') } } diff --git a/packages/example-project/package.json b/packages/example-project/package.json index 2e25c2b7..7a07d820 100644 --- a/packages/example-project/package.json +++ b/packages/example-project/package.json @@ -2,6 +2,7 @@ "name": "@hedron/example-project", "version": "1.0.0", "dependencies": { - "is-even": "^1.0.0" + "is-even": "^1.0.0", + "three-stdlib": "^2.34.0" } } diff --git a/packages/example-project/sketches/logo/index.ts b/packages/example-project/sketches/logo/index.ts index 8917cbb6..ca6a9207 100644 --- a/packages/example-project/sketches/logo/index.ts +++ b/packages/example-project/sketches/logo/index.ts @@ -1,9 +1,9 @@ import './test.js' +import { GLTFLoader } from 'three-stdlib' import hedronLogoUrl from './hedron-logo.glb' import matcapUrl from './matcap.jpg' -const { THREE, THREE_EXTRAS } = window.HEDRON.dependencies -const { GLTFLoader } = THREE_EXTRAS +const { THREE } = window.HEDRON.dependencies const gltfLoader = new GLTFLoader() const textureLoader = new THREE.TextureLoader() diff --git a/yarn.lock b/yarn.lock index 629f46df..6f5a741c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1024,7 +1024,6 @@ __metadata: dependencies: "@types/lodash.debounce": "npm:^4.0.9" lodash.debounce: "npm:^4.0.8" - three-stdlib: "npm:^2.34.0" tsup: "npm:^8.3.5" uid: "npm:^2.0.2" zustand: "npm:^5.0.2" @@ -1039,6 +1038,7 @@ __metadata: resolution: "@hedron/example-project@workspace:packages/example-project" dependencies: is-even: "npm:^1.0.0" + three-stdlib: "npm:^2.34.0" languageName: unknown linkType: soft