@needle-tools/materialx 1.0.0-next.e201067 → 1.0.0-next.ed2b37f

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/README.md CHANGED
@@ -1,20 +1,13 @@
1
1
  # Needle MaterialX
2
2
 
3
- ## Usage
3
+ ## How to use
4
4
 
5
- ### Vite
5
+ To use with Needle Engine simply import the module
6
6
 
7
- Make sure to disable `optimizeDeps` in your vite.config.js
8
- ```js
9
- // config:
10
- {
11
- optimizeDeps: {
12
- exclude: ['@needle-tools/materialx']
13
- },
14
- }
7
+ ```ts
8
+ import "@needle-tools/materialx"
15
9
  ```
16
10
 
17
-
18
11
  <br />
19
12
 
20
13
  # Contact ✒️
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/materialx",
3
- "version": "1.0.0-next.e201067",
3
+ "version": "1.0.0-next.ed2b37f",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "exports": {
@@ -8,11 +8,7 @@
8
8
  "import": "./index.ts",
9
9
  "require": "./index.js"
10
10
  },
11
- "./package.json": "./package.json",
12
- "./vite": {
13
- "import": "./src/vite/index.ts",
14
- "require": "./src/vite/index.js"
15
- }
11
+ "./package.json": "./package.json"
16
12
  },
17
13
  "peerDependencies": {
18
14
  "@needle-tools/engine": "4.x",
package/src/index.ts CHANGED
@@ -2,5 +2,4 @@
2
2
 
3
3
  const getMaterialXEnvironment = () => state.materialXEnvironment;
4
4
 
5
- export { initializeMaterialX, getMaterialXEnvironment };
6
- export { needleMaterialX } from "./vite/index.js";
5
+ export { initializeMaterialX, getMaterialXEnvironment };
package/src/materialx.ts CHANGED
@@ -38,7 +38,7 @@ export async function initializeMaterialX(): Promise<void> {
38
38
  /** @ts-ignore */
39
39
  import(`../bin/JsMaterialXGenShader.wasm?url`).then(m => m.default || m),
40
40
  /** @ts-ignore */
41
- import(`../bin/JsMaterialXGenShader.data?url`).then(m => m.default || m),
41
+ import(`../bin/JsMaterialXGenShader.data.txt?url`).then(m => m.default || m),
42
42
  ]);
43
43
  const [JsMaterialXCore, JsMaterialXGenShader, JsMaterialXGenShader_data] = urls;
44
44
 
package/src/vite/index.ts DELETED
@@ -1,19 +0,0 @@
1
- import { Plugin } from "vite";
2
-
3
- /**
4
- * Vite plugin to exclude the @needle-tools/materialx package from dependency optimization.
5
- */
6
- export function needleMaterialX(): Plugin {
7
- return {
8
- name: "needle-materialx",
9
- config: (config, _env) => {
10
- config.optimizeDeps ??= {};
11
- config.optimizeDeps.exclude ??= [];
12
- // to make .data files work
13
- if (!config.optimizeDeps.exclude.includes("@needle-tools/materialx")) {
14
- config.optimizeDeps.exclude.push("@needle-tools/materialx");
15
- }
16
- return config;
17
- }
18
- }
19
- }