Skip to content

Commit d008d2d

Browse files
committed
fix(plugin): use string for draco
1 parent 5162a65 commit d008d2d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

libs/plugin/src/generators/gltf/gltf.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface GltfGeneratorSchema {
77
output: string;
88
className: string;
99
selectorPrefix: string;
10-
draco?: boolean;
10+
draco: string;
1111
bones: boolean;
1212
meta: boolean;
1313
shadows: boolean;
@@ -65,12 +65,7 @@ function normalizeOptions(tree: Tree, options: GltfGeneratorSchema, gltfJsx: typ
6565
const modelPathFromRoot = join(tree.root, options.modelPath);
6666
const outputDir = dirname(options.output);
6767

68-
const injectGLTFOptions =
69-
options.transform && options.draco != null
70-
? `{ useDraco: ${options.draco} }`
71-
: options.transform
72-
? `{ useDraco: true }`
73-
: '';
68+
const injectGLTFOptions = options.transform ? `{ useDraco: ${options.draco === 'true'} }` : '';
7469

7570
const selector = `${options.selectorPrefix}-${fileName}`;
7671

libs/plugin/src/generators/gltf/schema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
"x-prompt": "Enter the prefix to use for the generated component selector (default: app)"
3535
},
3636
"draco": {
37-
"type": "boolean",
37+
"type": "string",
38+
"enum": ["true", "false", ""],
3839
"description": "Use DracoLoader",
3940
"alias": "d",
40-
"default": null
41+
"default": ""
4142
},
4243
"bones": {
4344
"type": "boolean",

0 commit comments

Comments
 (0)