Skip to content

Commit 157fd1c

Browse files
authored
Add build-examples script (#21584)
* Ignore ifc folder when linting * Add build-examples script * Normalize fflate imports * Wrap the output in an IIFE to avoid polluting the global scope * Add missing dep * Remove eslint comment not necessary anymore
1 parent 9bf1555 commit 157fd1c

File tree

8 files changed

+241
-6360
lines changed

8 files changed

+241
-6360
lines changed

examples/jsm/exporters/USDZExporter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { zipSync, strToU8 } from '../libs/fflate.module.min.js';
1+
import * as fflate from '../libs/fflate.module.min.js';
22

33
class USDZExporter {
44

@@ -34,7 +34,7 @@ class USDZExporter {
3434
output += buildMaterials( materials );
3535
output += buildTextures( textures );
3636

37-
const files = { 'model.usda': strToU8( output ) };
37+
const files = { 'model.usda': fflate.strToU8( output ) };
3838

3939
for ( const uuid in textures ) {
4040

@@ -70,7 +70,7 @@ class USDZExporter {
7070

7171
}
7272

73-
return zipSync( files, { level: 0 } );
73+
return fflate.zipSync( files, { level: 0 } );
7474

7575
}
7676

examples/jsm/loaders/LottieLoader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class LottieLoader extends Loader {
3636
container.style.height = data.h + 'px';
3737
document.body.appendChild( container );
3838

39-
// eslint-disable-next-line no-undef
4039
const animation = bodymovin.loadAnimation( {
4140
container: container,
4241
animType: 'canvas',

examples/jsm/loaders/TiltLoader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Quaternion,
1313
Vector3
1414
} from '../../../build/three.module.js';
15-
import { unzipSync, strFromU8 } from '../libs/fflate.module.min.js';
15+
import * as fflate from '../libs/fflate.module.min.js';
1616

1717
class TiltLoader extends Loader {
1818

@@ -56,7 +56,7 @@ class TiltLoader extends Loader {
5656
const group = new Group();
5757
// https://docs.google.com/document/d/11ZsHozYn9FnWG7y3s3WAyKIACfbfwb4PbaS8cZ_xjvo/edit#
5858

59-
const zip = unzipSync( new Uint8Array( buffer.slice( 16 ) ) );
59+
const zip = fflate.unzipSync( new Uint8Array( buffer.slice( 16 ) ) );
6060

6161
/*
6262
const thumbnail = zip[ 'thumbnail.png' ].buffer;
@@ -65,7 +65,7 @@ class TiltLoader extends Loader {
6565
document.body.appendChild( img );
6666
*/
6767

68-
const metadata = JSON.parse( strFromU8( zip[ 'metadata.json' ] ) );
68+
const metadata = JSON.parse( fflate.strFromU8( zip[ 'metadata.json' ] ) );
6969

7070
/*
7171
const blob = new Blob( [ zip[ 'data.sketch' ].buffer ], { type: 'application/octet-stream' } );

0 commit comments

Comments
 (0)