@needle-tools/gltf-progressive 1.0.0-alpha.17 → 1.0.0-alpha.18
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/CHANGELOG.md +1 -1
- package/README.md +81 -0
- package/examples/react-three-fiber/favicon.png +0 -0
- package/examples/react-three-fiber/index.html +5 -7
- package/examples/react-three-fiber/package-lock.json +223 -2
- package/examples/react-three-fiber/package.json +2 -1
- package/examples/react-three-fiber/vite.config.js +2 -7
- package/package.json +1 -1
- package/examples/react-three-fiber/dist/assets/index-1558b86e.css +0 -1
- package/examples/react-three-fiber/dist/assets/index-a23e0239.js +0 -4003
- package/examples/react-three-fiber/dist/index.html +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## [1.0.0-alpha.
|
|
7
|
+
## [1.0.0-alpha.18] - 2023-05-30
|
|
8
8
|
- update README
|
|
9
9
|
|
|
10
10
|
## [1.0.0-alpha.16] - 2023-05-29
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Support for loading of glTF or GLB files with progressive mesh or texture data for three.js based engines.
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
## Examples
|
|
6
8
|
|
|
7
9
|
Examples are in the `/examples` directory. Live versions can be found in the links below.
|
|
@@ -11,6 +13,85 @@ Examples are in the `/examples` directory. Live versions can be found in the lin
|
|
|
11
13
|
- [React Three Fiber](https://engine.needle.tools/demos/gltf-progressive/r3f/)
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### react three fiber
|
|
19
|
+
|
|
20
|
+
Full example in `examples/react-three-fiber`
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
function ChurchModel() {
|
|
24
|
+
const { gl } = useThree()
|
|
25
|
+
const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
|
|
26
|
+
const { scene } = useGLTF(url, false, false, (loader) => {
|
|
27
|
+
useNeedleProgressive(url, gl, loader as any)
|
|
28
|
+
})
|
|
29
|
+
return <primitive object={scene} />
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### threejs (CDN, no bundler)
|
|
34
|
+
|
|
35
|
+
The full example can be found at `examples/threejs`
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<head>
|
|
39
|
+
<!-- Add the threejs import map to your HTML head section -->
|
|
40
|
+
<script type="importmap">
|
|
41
|
+
{
|
|
42
|
+
"imports": {
|
|
43
|
+
"three": "https://cdn.jsdelivr.net/npm/three@latest/build/three.module.js",
|
|
44
|
+
"three/addons/": "https://cdn.jsdelivr.net/npm/three@latest/examples/jsm/",
|
|
45
|
+
"three/examples/": "https://cdn.jsdelivr.net/npm/three@latest/examples/",
|
|
46
|
+
"@needle-engine/gltf-progressive": "https://www.unpkg.com/@needle-tools/gltf-progressive@latest"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
</head>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
In your script:
|
|
54
|
+
```ts
|
|
55
|
+
const gltfLoader = new GLTFLoader();
|
|
56
|
+
|
|
57
|
+
const url = "https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb";
|
|
58
|
+
|
|
59
|
+
// register the progressive loader
|
|
60
|
+
useNeedleProgressive(url, renderer, gltfLoader)
|
|
61
|
+
|
|
62
|
+
// just call the load method as usual
|
|
63
|
+
gltfLoader.load(url, gltf => {
|
|
64
|
+
console.log(gltf)
|
|
65
|
+
scene.add(gltf.scene)
|
|
66
|
+
gltf.scene.position.y += .95;
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### \<model-viewer\>
|
|
72
|
+
|
|
73
|
+
The full example can be found in `examples/modelviewer.html`
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<head>
|
|
77
|
+
<!-- Include the import map and the gltf-progressive package -->
|
|
78
|
+
<script type="importmap">
|
|
79
|
+
{
|
|
80
|
+
"imports": {
|
|
81
|
+
"three": "https://unpkg.com/three/build/three.module.js",
|
|
82
|
+
"three/": "https://unpkg.com/three/"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
<script type="module" src="https://www.unpkg.com/@needle-tools/gltf-progressive@latest"></script>
|
|
87
|
+
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
|
|
91
|
+
<model-viewer src="https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb" camera-controls auto-rotate></model-viewer>
|
|
92
|
+
|
|
93
|
+
...
|
|
94
|
+
```
|
|
14
95
|
|
|
15
96
|
|
|
16
97
|
# Contact ✒️
|
|
Binary file
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" href="favicon.
|
|
5
|
+
<link rel="icon" href="favicon.png">
|
|
6
6
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
|
7
7
|
|
|
8
|
-
<title>
|
|
9
|
-
<meta name="description" content="🌵
|
|
8
|
+
<title>react-three-fiber with progressive loading</title>
|
|
9
|
+
<meta name="description" content="🌵 gltf-progressive example">
|
|
10
10
|
<meta name="twitter:card" content="summary_large_image">
|
|
11
|
-
<meta property="og:title" content="
|
|
12
|
-
<meta property="og:description" content="🌵
|
|
13
|
-
|
|
11
|
+
<meta property="og:title" content="react-three-fiber with progressive loading" />
|
|
12
|
+
<meta property="og:description" content="🌵 gltf-progressive example" />
|
|
14
13
|
<meta property="twitter:image" content="" />
|
|
15
14
|
<meta property="og:image" content="" />
|
|
16
15
|
|
|
17
16
|
<meta name="robots" content="index,follow">
|
|
18
|
-
<meta name="url" content="http://needle.tools">
|
|
19
17
|
<link rel="stylesheet" href="./src/style.css">
|
|
20
18
|
</head>
|
|
21
19
|
|
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
"@vitejs/plugin-basic-ssl": "^1.0.1",
|
|
24
24
|
"@vitejs/plugin-react": "^1.3.0",
|
|
25
25
|
"typescript": "4.1.3",
|
|
26
|
-
"vite": "<= 4.3.9"
|
|
26
|
+
"vite": "<= 4.3.9",
|
|
27
|
+
"vite-plugin-compression": "^0.5.1"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"../..": {
|
|
30
31
|
"name": "@needle-tools/gltf-progressive",
|
|
31
|
-
"version": "1.0.0-alpha.
|
|
32
|
+
"version": "1.0.0-alpha.17",
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
34
35
|
"@types/three": "0.162.0",
|
|
@@ -1515,6 +1516,20 @@
|
|
|
1515
1516
|
"version": "0.6.10",
|
|
1516
1517
|
"license": "MIT"
|
|
1517
1518
|
},
|
|
1519
|
+
"node_modules/fs-extra": {
|
|
1520
|
+
"version": "10.1.0",
|
|
1521
|
+
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
|
1522
|
+
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
|
1523
|
+
"dev": true,
|
|
1524
|
+
"dependencies": {
|
|
1525
|
+
"graceful-fs": "^4.2.0",
|
|
1526
|
+
"jsonfile": "^6.0.1",
|
|
1527
|
+
"universalify": "^2.0.0"
|
|
1528
|
+
},
|
|
1529
|
+
"engines": {
|
|
1530
|
+
"node": ">=12"
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1518
1533
|
"node_modules/fsevents": {
|
|
1519
1534
|
"version": "2.3.3",
|
|
1520
1535
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
@@ -1560,6 +1575,12 @@
|
|
|
1560
1575
|
"version": "0.0.0",
|
|
1561
1576
|
"license": "MIT"
|
|
1562
1577
|
},
|
|
1578
|
+
"node_modules/graceful-fs": {
|
|
1579
|
+
"version": "4.2.11",
|
|
1580
|
+
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
|
1581
|
+
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
|
1582
|
+
"dev": true
|
|
1583
|
+
},
|
|
1563
1584
|
"node_modules/has-flag": {
|
|
1564
1585
|
"version": "3.0.0",
|
|
1565
1586
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
|
@@ -1682,6 +1703,18 @@
|
|
|
1682
1703
|
"node": ">=6"
|
|
1683
1704
|
}
|
|
1684
1705
|
},
|
|
1706
|
+
"node_modules/jsonfile": {
|
|
1707
|
+
"version": "6.1.0",
|
|
1708
|
+
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
|
1709
|
+
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
|
1710
|
+
"dev": true,
|
|
1711
|
+
"dependencies": {
|
|
1712
|
+
"universalify": "^2.0.0"
|
|
1713
|
+
},
|
|
1714
|
+
"optionalDependencies": {
|
|
1715
|
+
"graceful-fs": "^4.1.6"
|
|
1716
|
+
}
|
|
1717
|
+
},
|
|
1685
1718
|
"node_modules/lie": {
|
|
1686
1719
|
"version": "3.3.0",
|
|
1687
1720
|
"license": "MIT",
|
|
@@ -2211,6 +2244,15 @@
|
|
|
2211
2244
|
"optional": true,
|
|
2212
2245
|
"peer": true
|
|
2213
2246
|
},
|
|
2247
|
+
"node_modules/universalify": {
|
|
2248
|
+
"version": "2.0.1",
|
|
2249
|
+
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
|
|
2250
|
+
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
|
|
2251
|
+
"dev": true,
|
|
2252
|
+
"engines": {
|
|
2253
|
+
"node": ">= 10.0.0"
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2214
2256
|
"node_modules/update-browserslist-db": {
|
|
2215
2257
|
"version": "1.0.13",
|
|
2216
2258
|
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
|
@@ -2314,6 +2356,90 @@
|
|
|
2314
2356
|
}
|
|
2315
2357
|
}
|
|
2316
2358
|
},
|
|
2359
|
+
"node_modules/vite-plugin-compression": {
|
|
2360
|
+
"version": "0.5.1",
|
|
2361
|
+
"resolved": "https://registry.npmjs.org/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
|
|
2362
|
+
"integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
|
|
2363
|
+
"dev": true,
|
|
2364
|
+
"dependencies": {
|
|
2365
|
+
"chalk": "^4.1.2",
|
|
2366
|
+
"debug": "^4.3.3",
|
|
2367
|
+
"fs-extra": "^10.0.0"
|
|
2368
|
+
},
|
|
2369
|
+
"peerDependencies": {
|
|
2370
|
+
"vite": ">=2.0.0"
|
|
2371
|
+
}
|
|
2372
|
+
},
|
|
2373
|
+
"node_modules/vite-plugin-compression/node_modules/ansi-styles": {
|
|
2374
|
+
"version": "4.3.0",
|
|
2375
|
+
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
|
2376
|
+
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
|
2377
|
+
"dev": true,
|
|
2378
|
+
"dependencies": {
|
|
2379
|
+
"color-convert": "^2.0.1"
|
|
2380
|
+
},
|
|
2381
|
+
"engines": {
|
|
2382
|
+
"node": ">=8"
|
|
2383
|
+
},
|
|
2384
|
+
"funding": {
|
|
2385
|
+
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2388
|
+
"node_modules/vite-plugin-compression/node_modules/chalk": {
|
|
2389
|
+
"version": "4.1.2",
|
|
2390
|
+
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
2391
|
+
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
2392
|
+
"dev": true,
|
|
2393
|
+
"dependencies": {
|
|
2394
|
+
"ansi-styles": "^4.1.0",
|
|
2395
|
+
"supports-color": "^7.1.0"
|
|
2396
|
+
},
|
|
2397
|
+
"engines": {
|
|
2398
|
+
"node": ">=10"
|
|
2399
|
+
},
|
|
2400
|
+
"funding": {
|
|
2401
|
+
"url": "https://github.com/chalk/chalk?sponsor=1"
|
|
2402
|
+
}
|
|
2403
|
+
},
|
|
2404
|
+
"node_modules/vite-plugin-compression/node_modules/color-convert": {
|
|
2405
|
+
"version": "2.0.1",
|
|
2406
|
+
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
|
2407
|
+
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
|
2408
|
+
"dev": true,
|
|
2409
|
+
"dependencies": {
|
|
2410
|
+
"color-name": "~1.1.4"
|
|
2411
|
+
},
|
|
2412
|
+
"engines": {
|
|
2413
|
+
"node": ">=7.0.0"
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
"node_modules/vite-plugin-compression/node_modules/color-name": {
|
|
2417
|
+
"version": "1.1.4",
|
|
2418
|
+
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
|
2419
|
+
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
|
2420
|
+
"dev": true
|
|
2421
|
+
},
|
|
2422
|
+
"node_modules/vite-plugin-compression/node_modules/has-flag": {
|
|
2423
|
+
"version": "4.0.0",
|
|
2424
|
+
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
|
2425
|
+
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
|
2426
|
+
"dev": true,
|
|
2427
|
+
"engines": {
|
|
2428
|
+
"node": ">=8"
|
|
2429
|
+
}
|
|
2430
|
+
},
|
|
2431
|
+
"node_modules/vite-plugin-compression/node_modules/supports-color": {
|
|
2432
|
+
"version": "7.2.0",
|
|
2433
|
+
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
2434
|
+
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
2435
|
+
"dev": true,
|
|
2436
|
+
"dependencies": {
|
|
2437
|
+
"has-flag": "^4.0.0"
|
|
2438
|
+
},
|
|
2439
|
+
"engines": {
|
|
2440
|
+
"node": ">=8"
|
|
2441
|
+
}
|
|
2442
|
+
},
|
|
2317
2443
|
"node_modules/webgl-constants": {
|
|
2318
2444
|
"version": "1.1.1"
|
|
2319
2445
|
},
|
|
@@ -3291,6 +3417,17 @@
|
|
|
3291
3417
|
"fflate": {
|
|
3292
3418
|
"version": "0.6.10"
|
|
3293
3419
|
},
|
|
3420
|
+
"fs-extra": {
|
|
3421
|
+
"version": "10.1.0",
|
|
3422
|
+
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
|
|
3423
|
+
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
|
3424
|
+
"dev": true,
|
|
3425
|
+
"requires": {
|
|
3426
|
+
"graceful-fs": "^4.2.0",
|
|
3427
|
+
"jsonfile": "^6.0.1",
|
|
3428
|
+
"universalify": "^2.0.0"
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3294
3431
|
"fsevents": {
|
|
3295
3432
|
"version": "2.3.3",
|
|
3296
3433
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
@@ -3319,6 +3456,12 @@
|
|
|
3319
3456
|
"glsl-noise": {
|
|
3320
3457
|
"version": "0.0.0"
|
|
3321
3458
|
},
|
|
3459
|
+
"graceful-fs": {
|
|
3460
|
+
"version": "4.2.11",
|
|
3461
|
+
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
|
3462
|
+
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
|
3463
|
+
"dev": true
|
|
3464
|
+
},
|
|
3322
3465
|
"has-flag": {
|
|
3323
3466
|
"version": "3.0.0",
|
|
3324
3467
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
|
@@ -3392,6 +3535,16 @@
|
|
|
3392
3535
|
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
|
3393
3536
|
"dev": true
|
|
3394
3537
|
},
|
|
3538
|
+
"jsonfile": {
|
|
3539
|
+
"version": "6.1.0",
|
|
3540
|
+
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
|
3541
|
+
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
|
3542
|
+
"dev": true,
|
|
3543
|
+
"requires": {
|
|
3544
|
+
"graceful-fs": "^4.1.6",
|
|
3545
|
+
"universalify": "^2.0.0"
|
|
3546
|
+
}
|
|
3547
|
+
},
|
|
3395
3548
|
"lie": {
|
|
3396
3549
|
"version": "3.3.0",
|
|
3397
3550
|
"requires": {
|
|
@@ -3744,6 +3897,12 @@
|
|
|
3744
3897
|
"optional": true,
|
|
3745
3898
|
"peer": true
|
|
3746
3899
|
},
|
|
3900
|
+
"universalify": {
|
|
3901
|
+
"version": "2.0.1",
|
|
3902
|
+
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
|
|
3903
|
+
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
|
|
3904
|
+
"dev": true
|
|
3905
|
+
},
|
|
3747
3906
|
"update-browserslist-db": {
|
|
3748
3907
|
"version": "1.0.13",
|
|
3749
3908
|
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
|
@@ -3776,6 +3935,68 @@
|
|
|
3776
3935
|
"rollup": "^3.21.0"
|
|
3777
3936
|
}
|
|
3778
3937
|
},
|
|
3938
|
+
"vite-plugin-compression": {
|
|
3939
|
+
"version": "0.5.1",
|
|
3940
|
+
"resolved": "https://registry.npmjs.org/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
|
|
3941
|
+
"integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
|
|
3942
|
+
"dev": true,
|
|
3943
|
+
"requires": {
|
|
3944
|
+
"chalk": "^4.1.2",
|
|
3945
|
+
"debug": "^4.3.3",
|
|
3946
|
+
"fs-extra": "^10.0.0"
|
|
3947
|
+
},
|
|
3948
|
+
"dependencies": {
|
|
3949
|
+
"ansi-styles": {
|
|
3950
|
+
"version": "4.3.0",
|
|
3951
|
+
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
|
3952
|
+
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
|
3953
|
+
"dev": true,
|
|
3954
|
+
"requires": {
|
|
3955
|
+
"color-convert": "^2.0.1"
|
|
3956
|
+
}
|
|
3957
|
+
},
|
|
3958
|
+
"chalk": {
|
|
3959
|
+
"version": "4.1.2",
|
|
3960
|
+
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
3961
|
+
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
3962
|
+
"dev": true,
|
|
3963
|
+
"requires": {
|
|
3964
|
+
"ansi-styles": "^4.1.0",
|
|
3965
|
+
"supports-color": "^7.1.0"
|
|
3966
|
+
}
|
|
3967
|
+
},
|
|
3968
|
+
"color-convert": {
|
|
3969
|
+
"version": "2.0.1",
|
|
3970
|
+
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
|
3971
|
+
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
|
3972
|
+
"dev": true,
|
|
3973
|
+
"requires": {
|
|
3974
|
+
"color-name": "~1.1.4"
|
|
3975
|
+
}
|
|
3976
|
+
},
|
|
3977
|
+
"color-name": {
|
|
3978
|
+
"version": "1.1.4",
|
|
3979
|
+
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
|
3980
|
+
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
|
3981
|
+
"dev": true
|
|
3982
|
+
},
|
|
3983
|
+
"has-flag": {
|
|
3984
|
+
"version": "4.0.0",
|
|
3985
|
+
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
|
3986
|
+
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
|
3987
|
+
"dev": true
|
|
3988
|
+
},
|
|
3989
|
+
"supports-color": {
|
|
3990
|
+
"version": "7.2.0",
|
|
3991
|
+
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
3992
|
+
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
3993
|
+
"dev": true,
|
|
3994
|
+
"requires": {
|
|
3995
|
+
"has-flag": "^4.0.0"
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
},
|
|
3779
4000
|
"webgl-constants": {
|
|
3780
4001
|
"version": "1.1.1"
|
|
3781
4002
|
},
|
|
@@ -2,6 +2,7 @@ import * as path from 'path';
|
|
|
2
2
|
import { defineConfig } from 'vite';
|
|
3
3
|
import react from '@vitejs/plugin-react';
|
|
4
4
|
import basicSsl from '@vitejs/plugin-basic-ssl'
|
|
5
|
+
import viteCompression from 'vite-plugin-compression';
|
|
5
6
|
|
|
6
7
|
export default defineConfig(async (command) => {
|
|
7
8
|
|
|
@@ -13,6 +14,7 @@ export default defineConfig(async (command) => {
|
|
|
13
14
|
plugins: [
|
|
14
15
|
react(),
|
|
15
16
|
basicSsl(),
|
|
17
|
+
viteCompression({ deleteOriginFile: true }),
|
|
16
18
|
],
|
|
17
19
|
|
|
18
20
|
server: {
|
|
@@ -20,19 +22,12 @@ export default defineConfig(async (command) => {
|
|
|
20
22
|
proxy: { // workaround: specifying a proxy skips HTTP2 which is currently problematic in Vite since it causes session memory timeouts.
|
|
21
23
|
'https://localhost:3000': 'https://localhost:3000'
|
|
22
24
|
},
|
|
23
|
-
watch: {
|
|
24
|
-
awaitWriteFinish: {
|
|
25
|
-
stabilityThreshold: 500,
|
|
26
|
-
pollInterval: 1000
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
25
|
strictPort: true,
|
|
30
26
|
port: 3001
|
|
31
27
|
},
|
|
32
28
|
build: {
|
|
33
29
|
outDir: "./dist",
|
|
34
30
|
emptyOutDir: true,
|
|
35
|
-
keepNames: true,
|
|
36
31
|
},
|
|
37
32
|
resolve: {
|
|
38
33
|
alias: {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0;padding:0}body{background:#f0f0f0}
|