@needle-tools/gltf-build-pipeline 2.1.0-alpha.2 → 2.1.0-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.2",
3
+ "version": "2.1.0-alpha.3",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -181,4 +181,12 @@ Each version will be compressed and written to the output directory.
181
181
  writeFileStatsToFile(config, file_stats, statsFile);
182
182
  }
183
183
  });
184
- program.run();
184
+ program.run().catch(err => {
185
+ // Since we still invoke this package with paths when running npm scripts we need to ignore this error
186
+ // We might want to move this code here into an extra package.
187
+ if (err.message.includes("Unknown command") && !err.message.includes("Did you mean")) {
188
+ // ignore
189
+ return;
190
+ }
191
+ throw err;
192
+ });
@@ -7,7 +7,7 @@ export type PackGLTFOptions = {
7
7
  packedFiles?: Set<string>;
8
8
  stats?: Stats;
9
9
  file_stats: FileStats[] | null;
10
- config?: Config;
10
+ config: Config;
11
11
  logger?: ILogger;
12
12
  };
13
13
  /** Compress a glTF file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.2",
3
+ "version": "2.1.0-alpha.3",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -70,12 +70,15 @@ const stats = {
70
70
  totalFileSizeInMBBefore: 0,
71
71
  };
72
72
 
73
+ const config = getConfig();
74
+
73
75
 
74
76
  /** Compress a glTF file
75
77
  * @param {string} file
76
78
  */
77
79
  async function packFile(file) {
78
80
  return packGLTF(file, file, {
81
+ config,
79
82
  debug,
80
83
  packedFiles,
81
84
  useCache: allowCaching,
@@ -86,7 +89,6 @@ async function packFile(file) {
86
89
 
87
90
  const inputArgs = args.slice(2);
88
91
  let failed = false;
89
- const config = getConfig();
90
92
  const logger = new Logger(Verbosity.INFO);
91
93
 
92
94
  foreachGLTF(inputArgs, async (file) => {