@needle-tools/engine 4.16.5-next.c1731f4 → 4.16.6
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/dist/gltf-progressive-BacJPTD6.umd.cjs +10 -0
- package/dist/gltf-progressive-BmXoz_HR.min.js +10 -0
- package/dist/gltf-progressive-CzxjNmG6.js +1537 -0
- package/dist/loader.worker-BqODMeeW.js +23 -0
- package/dist/{materialx-DQ6OMWe8.js → materialx-BgYphGV9.js} +7 -6
- package/dist/{materialx-C3cdjbh7.umd.cjs → materialx-Dk-cjpFv.umd.cjs} +1 -1
- package/dist/{materialx-DwkZECrV.min.js → materialx-bmTetdSz.min.js} +1 -1
- package/dist/{needle-engine.bundle-CccTL32C.js → needle-engine.bundle-BN_X4iTv.js} +2495 -2456
- package/dist/{needle-engine.bundle-DXd0yCBg.umd.cjs → needle-engine.bundle-D-slQEcs.umd.cjs} +152 -152
- package/dist/{needle-engine.bundle-XVF9W1_-.min.js → needle-engine.bundle-DY-lNV9M.min.js} +121 -121
- package/dist/needle-engine.d.ts +193 -102
- package/dist/needle-engine.js +3 -3
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/three-examples.js +4643 -3294
- package/dist/three-examples.min.js +47 -13
- package/dist/three-examples.umd.cjs +46 -12
- package/dist/three.js +15999 -24892
- package/dist/three.min.js +214 -214
- package/dist/three.umd.cjs +208 -208
- package/dist/{vendor-CQMI3jTS.js → vendor-BsRxp-FT.js} +901 -862
- package/dist/{vendor-CipoooTV.umd.cjs → vendor-BwxpsdCm.umd.cjs} +20 -20
- package/dist/{vendor-BPp9F5vR.min.js → vendor-DZ45lcA8.min.js} +19 -19
- package/lib/engine/engine_application.d.ts +0 -9
- package/lib/engine/engine_application.js.map +1 -1
- package/lib/engine/engine_feature_flags.d.ts +3 -3
- package/lib/engine/engine_feature_flags.js +5 -3
- package/lib/engine/engine_feature_flags.js.map +1 -1
- package/lib/engine/engine_modules.d.ts +30 -26
- package/lib/engine/engine_modules.js +103 -32
- package/lib/engine/engine_modules.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +144 -57
- package/lib/engine/webcomponents/needle-engine.js +10 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/package.json +2 -4
- package/plugins/next/meshbvhworker.cjs +19 -0
- package/plugins/next/next.js +4 -34
- package/plugins/vite/alias.d.ts +1 -1
- package/plugins/vite/alias.js +82 -87
- package/plugins/vite/build-pipeline.js +3 -4
- package/plugins/vite/dependencies.js +5 -7
- package/plugins/vite/drop.js +8 -6
- package/plugins/vite/editor-connection.js +1 -2
- package/plugins/vite/poster.js +1 -2
- package/plugins/vite/reload.js +2 -7
- package/plugins/vite/transform-codegen.js +2 -6
- package/src/engine/engine_application.ts +0 -10
- package/src/engine/engine_feature_flags.ts +7 -3
- package/src/engine/engine_modules.ts +101 -39
- package/src/engine/webcomponents/needle-engine.ts +189 -59
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
- package/dist/gltf-progressive-BJ9OrddA.js +0 -28272
- package/dist/gltf-progressive-Ck_bXBr_.umd.cjs +0 -4022
- package/dist/gltf-progressive-CqZYu6Hx.min.js +0 -4022
- package/dist/loader.worker-CCrD-Ycm.js +0 -3
- package/plugins/next/meshbvhworker-import.cjs +0 -40
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// Transforms GenerateMeshBVHWorker.js to replace the bare package specifier
|
|
3
|
-
// in `new URL('three-mesh-bvh/...', import.meta.url)` with a resolved relative path.
|
|
4
|
-
// Webpack 5 supports the `new Worker(new URL('./relative.js', import.meta.url))` pattern
|
|
5
|
-
// natively and will bundle the worker with all its dependencies as a separate chunk.
|
|
6
|
-
// We also prepend a `self.window = self` shim to handle three.js referencing `window`
|
|
7
|
-
// in a worker context.
|
|
8
|
-
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @param {string} source
|
|
13
|
-
*/
|
|
14
|
-
module.exports = function (source) {
|
|
15
|
-
if (source.includes("Modified by Needle")) return source;
|
|
16
|
-
console.log("Transform GenerateMeshBVHWorker import");
|
|
17
|
-
|
|
18
|
-
// Resolve the actual file path of the worker
|
|
19
|
-
let workerPath;
|
|
20
|
-
try {
|
|
21
|
-
workerPath = require.resolve('three-mesh-bvh/src/workers/generateMeshBVH.worker.js');
|
|
22
|
-
} catch {
|
|
23
|
-
console.warn("Could not resolve three-mesh-bvh worker path, skipping transform");
|
|
24
|
-
return source;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Make it relative to the source file being transformed
|
|
28
|
-
const sourceDir = path.dirname(this.resourcePath);
|
|
29
|
-
let relativePath = path.relative(sourceDir, workerPath).replace(/\\/g, '/');
|
|
30
|
-
if (!relativePath.startsWith('.')) relativePath = './' + relativePath;
|
|
31
|
-
|
|
32
|
-
// Replace the bare package specifier with the relative path.
|
|
33
|
-
// Webpack 5 will detect `new Worker(new URL(..., import.meta.url))` and bundle it correctly.
|
|
34
|
-
source = source.replace(
|
|
35
|
-
`'three-mesh-bvh/src/workers/generateMeshBVH.worker.js'`,
|
|
36
|
-
`'${relativePath}'`
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
return `// Modified by Needle\n${source}`;
|
|
40
|
-
};
|