@sequent-org/ifc-viewer 1.0.2-ci.2.0
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/.github/workflows/npm-publish.yml +39 -0
- package/console-log.txt +1924 -0
- package/fragments.html +46 -0
- package/index.html +101 -0
- package/package.json +27 -0
- package/postcss.config.cjs +7 -0
- package/public/wasm/web-ifc.wasm +0 -0
- package/src/compat/three-buffer-geometry-utils.js +39 -0
- package/src/fragments-main.js +22 -0
- package/src/ifc/IfcService.js +268 -0
- package/src/ifc/IfcTreeView.js +96 -0
- package/src/main.js +216 -0
- package/src/style.css +2 -0
- package/src/viewer/NavCube.js +395 -0
- package/src/viewer/SectionManipulator.js +260 -0
- package/src/viewer/Viewer.js +880 -0
- package/tailwind.config.cjs +5 -0
- package/vite.config.js +36 -0
package/vite.config.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [
|
|
6
|
+
{
|
|
7
|
+
name: 'ifc-wasm-rewrite',
|
|
8
|
+
configureServer(server) {
|
|
9
|
+
server.middlewares.use((req, res, next) => {
|
|
10
|
+
const url = req.url || '';
|
|
11
|
+
// Перенаправляем любые запросы воркера к wasm внутри node_modules на наш публичный ассет
|
|
12
|
+
if (url.startsWith('/node_modules/web-ifc-three/wasm/web-ifc.wasm') || url.includes('/node_modules/web-ifc-three//wasm/web-ifc.wasm')) {
|
|
13
|
+
res.statusCode = 302;
|
|
14
|
+
res.setHeader('Location', '/wasm/web-ifc.wasm');
|
|
15
|
+
res.end();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
next();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
resolve: {
|
|
24
|
+
alias: {
|
|
25
|
+
// web-ifc-three ожидает mergeGeometries в BufferGeometryUtils,
|
|
26
|
+
// в three@0.149 его нет. Шимим через mergeBufferGeometries.
|
|
27
|
+
'three/examples/jsm/utils/BufferGeometryUtils': fileURLToPath(new URL('./src/compat/three-buffer-geometry-utils.js', import.meta.url)),
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
optimizeDeps: {
|
|
31
|
+
// Не оптимизировать emscripten-модули, чтобы не ломать загрузку wasm
|
|
32
|
+
exclude: ['web-ifc', 'web-ifc-three'],
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|