فهرست منبع

feat: export vue compiler options for Tres custom renderer (#324)

* feat: export vue compiler options for Tres custom renderer

* docs: added vite config vue compiler options

* docs: Update docs/guide/index.md

Co-authored-by: Tino Koch <17991193+Tinoooo@users.noreply.github.com>

---------

Co-authored-by: Tino Koch <17991193+Tinoooo@users.noreply.github.com>
Alvaro Saburido 1 سال پیش
والد
کامیت
66716d523f

+ 1 - 1
.vscode/settings.json

@@ -11,7 +11,7 @@
     "editor.defaultFormatter": "esbenp.prettier-vscode"
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   },
   },
   "[typescript]": {
   "[typescript]": {
-    "editor.defaultFormatter": "esbenp.prettier-vscode"
+    "editor.defaultFormatter": "vscode.typescript-language-features"
   },
   },
   "scss.lint.unknownAtRules": "ignore",
   "scss.lint.unknownAtRules": "ignore",
   "css.lint.unknownAtRules": "ignore",
   "css.lint.unknownAtRules": "ignore",

+ 19 - 0
docs/guide/index.md

@@ -41,6 +41,25 @@ pnpm add @types/three -D
 ```
 ```
 :::
 :::
 
 
+## Vite
+
+If you are using Vite, you have add the following to your `vite.config.ts`:
+
+```ts
+import { templateCompilerOptions } from '@tresjs/core'
+
+export default defineConfig({
+  plugins: [
+    vue({
+      // Other config
+      ...templateCompilerOptions
+    }),
+  ],
+}),
+```
+
+This is required to make the template compiler work with the custom renderer and not throw warnings on the console. For more info check [here](/guide/troubleshooting.html).
+
 ## Try it online
 ## Try it online
 
 
 We have a brand new [StackBlitz](https://stackblitz.com/) starter to try TresJS online. Check it out:
 We have a brand new [StackBlitz](https://stackblitz.com/) starter to try TresJS online. Check it out:

+ 3 - 5
docs/guide/troubleshooting.md

@@ -63,15 +63,13 @@ Got to your `vite.config.ts` and add the following configuration to the `@vitejs
 ```ts
 ```ts
 import { defineConfig } from 'vite'
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import vue from '@vitejs/plugin-vue'
+import { templateCompilerOptions } from '@tresjs/core'
 
 
 export default defineConfig({
 export default defineConfig({
   plugins: [
   plugins: [
     vue({
     vue({
-      template: {
-        compilerOptions: {
-          isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas') || tag === 'primitive',
-        },
-      },
+      // Other config
+      ...templateCompilerOptions,
     }),
     }),
   ],
   ],
 })
 })

+ 1 - 1
package.json

@@ -102,7 +102,7 @@
     "vite-plugin-inspect": "^0.7.29",
     "vite-plugin-inspect": "^0.7.29",
     "vite-plugin-require-transform": "^1.0.17",
     "vite-plugin-require-transform": "^1.0.17",
     "vite-svg-loader": "^4.0.0",
     "vite-svg-loader": "^4.0.0",
-    "vitepress": "1.0.0-beta.2",
+    "vitepress": "1.0.0-beta.3",
     "vitest": "^0.32.2",
     "vitest": "^0.32.2",
     "vue": "^3.3.4",
     "vue": "^3.3.4",
     "vue-demi": "^0.14.5"
     "vue-demi": "^0.14.5"

+ 1 - 1
playground/.eslintrc-auto-import.json

@@ -60,4 +60,4 @@
     "watchSyncEffect": true,
     "watchSyncEffect": true,
     "toValue": true
     "toValue": true
   }
   }
-}
+}

+ 1 - 3
playground/components.d.ts

@@ -3,11 +3,9 @@
 // @ts-nocheck
 // @ts-nocheck
 // Generated by unplugin-vue-components
 // Generated by unplugin-vue-components
 // Read more: https://github.com/vuejs/core/pull/3399
 // Read more: https://github.com/vuejs/core/pull/3399
-import '@vue/runtime-core'
-
 export {}
 export {}
 
 
-declare module '@vue/runtime-core' {
+declare module 'vue' {
   export interface GlobalComponents {
   export interface GlobalComponents {
     AnimatedModel: typeof import('./src/components/AnimatedModel.vue')['default']
     AnimatedModel: typeof import('./src/components/AnimatedModel.vue')['default']
     Cameras: typeof import('./src/components/Cameras.vue')['default']
     Cameras: typeof import('./src/components/Cameras.vue')['default']

+ 2 - 10
playground/vite.config.ts

@@ -5,21 +5,13 @@ import AutoImport from 'unplugin-auto-import/vite'
 import Components from 'unplugin-vue-components/vite'
 import Components from 'unplugin-vue-components/vite'
 import glsl from 'vite-plugin-glsl'
 import glsl from 'vite-plugin-glsl'
 import UnoCSS from 'unocss/vite'
 import UnoCSS from 'unocss/vite'
+import { templateCompilerOptions } from '@tresjs/core'
 
 
 // https://vitejs.dev/config/
 // https://vitejs.dev/config/
 export default defineConfig({
 export default defineConfig({
   plugins: [
   plugins: [
     glsl(),
     glsl(),
-    vue({
-      script: {
-        propsDestructure: true,
-      },
-      template: {
-        compilerOptions: {
-          isCustomElement: tag => (tag.startsWith('Tres') && tag !== 'TresCanvas' && tag !== 'TresLeches') || tag === 'primitive',
-        },
-      },
-    }),
+    vue(templateCompilerOptions),
     AutoImport({
     AutoImport({
       dts: true,
       dts: true,
       eslintrc: {
       eslintrc: {

+ 91 - 39
pnpm-lock.yaml

@@ -35,10 +35,10 @@ importers:
         version: 0.152.1
         version: 0.152.1
       '@typescript-eslint/eslint-plugin':
       '@typescript-eslint/eslint-plugin':
         specifier: ^5.60.0
         specifier: ^5.60.0
-        version: 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3)
+        version: 5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.5)
       '@typescript-eslint/parser':
       '@typescript-eslint/parser':
         specifier: ^5.60.0
         specifier: ^5.60.0
-        version: 5.60.0(eslint@8.43.0)(typescript@5.1.3)
+        version: 5.60.0(eslint@8.43.0)(typescript@5.1.5)
       '@vitejs/plugin-vue':
       '@vitejs/plugin-vue':
         specifier: ^4.2.3
         specifier: ^4.2.3
         version: 4.2.3(vite@4.3.9)(vue@3.3.4)
         version: 4.2.3(vite@4.3.9)(vue@3.3.4)
@@ -124,8 +124,8 @@ importers:
         specifier: ^4.0.0
         specifier: ^4.0.0
         version: 4.0.0
         version: 4.0.0
       vitepress:
       vitepress:
-        specifier: 1.0.0-beta.2
-        version: 1.0.0-beta.2(@algolia/client-search@4.18.0)(search-insights@2.6.0)
+        specifier: 1.0.0-beta.3
+        version: 1.0.0-beta.3(@algolia/client-search@4.18.0)(search-insights@2.6.0)
       vitest:
       vitest:
         specifier: ^0.32.2
         specifier: ^0.32.2
         version: 0.32.2(@vitest/ui@0.32.2)(jsdom@22.1.0)
         version: 0.32.2(@vitest/ui@0.32.2)(jsdom@22.1.0)
@@ -168,7 +168,7 @@ importers:
         version: 1.1.2(vite@4.3.9)
         version: 1.1.2(vite@4.3.9)
       vue-tsc:
       vue-tsc:
         specifier: ^1.8.1
         specifier: ^1.8.1
-        version: 1.8.1(typescript@5.1.3)
+        version: 1.8.1(typescript@5.1.5)
 
 
 packages:
 packages:
 
 
@@ -1294,7 +1294,7 @@ packages:
   /@types/webxr@0.5.2:
   /@types/webxr@0.5.2:
     resolution: {integrity: sha512-szL74BnIcok9m7QwYtVmQ+EdIKwbjPANudfuvDrAF8Cljg9MKUlIoc1w5tjj9PMpeSH3U1Xnx//czQybJ0EfSw==}
     resolution: {integrity: sha512-szL74BnIcok9m7QwYtVmQ+EdIKwbjPANudfuvDrAF8Cljg9MKUlIoc1w5tjj9PMpeSH3U1Xnx//czQybJ0EfSw==}
 
 
-  /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.3):
+  /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.0)(eslint@8.43.0)(typescript@5.1.5):
     resolution: {integrity: sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==}
     resolution: {integrity: sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
     peerDependencies:
@@ -1306,23 +1306,23 @@ packages:
         optional: true
         optional: true
     dependencies:
     dependencies:
       '@eslint-community/regexpp': 4.5.1
       '@eslint-community/regexpp': 4.5.1
-      '@typescript-eslint/parser': 5.60.0(eslint@8.43.0)(typescript@5.1.3)
+      '@typescript-eslint/parser': 5.60.0(eslint@8.43.0)(typescript@5.1.5)
       '@typescript-eslint/scope-manager': 5.60.0
       '@typescript-eslint/scope-manager': 5.60.0
-      '@typescript-eslint/type-utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3)
-      '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3)
+      '@typescript-eslint/type-utils': 5.60.0(eslint@8.43.0)(typescript@5.1.5)
+      '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.5)
       debug: 4.3.4
       debug: 4.3.4
       eslint: 8.43.0
       eslint: 8.43.0
       grapheme-splitter: 1.0.4
       grapheme-splitter: 1.0.4
       ignore: 5.2.4
       ignore: 5.2.4
       natural-compare-lite: 1.4.0
       natural-compare-lite: 1.4.0
       semver: 7.5.3
       semver: 7.5.3
-      tsutils: 3.21.0(typescript@5.1.3)
-      typescript: 5.1.3
+      tsutils: 3.21.0(typescript@5.1.5)
+      typescript: 5.1.5
     transitivePeerDependencies:
     transitivePeerDependencies:
       - supports-color
       - supports-color
     dev: true
     dev: true
 
 
-  /@typescript-eslint/parser@5.60.0(eslint@8.43.0)(typescript@5.1.3):
+  /@typescript-eslint/parser@5.60.0(eslint@8.43.0)(typescript@5.1.5):
     resolution: {integrity: sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==}
     resolution: {integrity: sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
     peerDependencies:
@@ -1334,10 +1334,10 @@ packages:
     dependencies:
     dependencies:
       '@typescript-eslint/scope-manager': 5.60.0
       '@typescript-eslint/scope-manager': 5.60.0
       '@typescript-eslint/types': 5.60.0
       '@typescript-eslint/types': 5.60.0
-      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3)
+      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.5)
       debug: 4.3.4
       debug: 4.3.4
       eslint: 8.43.0
       eslint: 8.43.0
-      typescript: 5.1.3
+      typescript: 5.1.5
     transitivePeerDependencies:
     transitivePeerDependencies:
       - supports-color
       - supports-color
     dev: true
     dev: true
@@ -1350,7 +1350,7 @@ packages:
       '@typescript-eslint/visitor-keys': 5.60.0
       '@typescript-eslint/visitor-keys': 5.60.0
     dev: true
     dev: true
 
 
-  /@typescript-eslint/type-utils@5.60.0(eslint@8.43.0)(typescript@5.1.3):
+  /@typescript-eslint/type-utils@5.60.0(eslint@8.43.0)(typescript@5.1.5):
     resolution: {integrity: sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g==}
     resolution: {integrity: sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
     peerDependencies:
@@ -1360,12 +1360,12 @@ packages:
       typescript:
       typescript:
         optional: true
         optional: true
     dependencies:
     dependencies:
-      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3)
-      '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.3)
+      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.5)
+      '@typescript-eslint/utils': 5.60.0(eslint@8.43.0)(typescript@5.1.5)
       debug: 4.3.4
       debug: 4.3.4
       eslint: 8.43.0
       eslint: 8.43.0
-      tsutils: 3.21.0(typescript@5.1.3)
-      typescript: 5.1.3
+      tsutils: 3.21.0(typescript@5.1.5)
+      typescript: 5.1.5
     transitivePeerDependencies:
     transitivePeerDependencies:
       - supports-color
       - supports-color
     dev: true
     dev: true
@@ -1375,7 +1375,7 @@ packages:
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     dev: true
     dev: true
 
 
-  /@typescript-eslint/typescript-estree@5.60.0(typescript@5.1.3):
+  /@typescript-eslint/typescript-estree@5.60.0(typescript@5.1.5):
     resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==}
     resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
     peerDependencies:
@@ -1390,13 +1390,13 @@ packages:
       globby: 11.1.0
       globby: 11.1.0
       is-glob: 4.0.3
       is-glob: 4.0.3
       semver: 7.5.3
       semver: 7.5.3
-      tsutils: 3.21.0(typescript@5.1.3)
-      typescript: 5.1.3
+      tsutils: 3.21.0(typescript@5.1.5)
+      typescript: 5.1.5
     transitivePeerDependencies:
     transitivePeerDependencies:
       - supports-color
       - supports-color
     dev: true
     dev: true
 
 
-  /@typescript-eslint/utils@5.60.0(eslint@8.43.0)(typescript@5.1.3):
+  /@typescript-eslint/utils@5.60.0(eslint@8.43.0)(typescript@5.1.5):
     resolution: {integrity: sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==}
     resolution: {integrity: sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
     peerDependencies:
     peerDependencies:
@@ -1407,7 +1407,7 @@ packages:
       '@types/semver': 7.5.0
       '@types/semver': 7.5.0
       '@typescript-eslint/scope-manager': 5.60.0
       '@typescript-eslint/scope-manager': 5.60.0
       '@typescript-eslint/types': 5.60.0
       '@typescript-eslint/types': 5.60.0
-      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.3)
+      '@typescript-eslint/typescript-estree': 5.60.0(typescript@5.1.5)
       eslint: 8.43.0
       eslint: 8.43.0
       eslint-scope: 5.1.1
       eslint-scope: 5.1.1
       semver: 7.5.3
       semver: 7.5.3
@@ -1935,7 +1935,7 @@ packages:
   /@vue/devtools-api@6.5.0:
   /@vue/devtools-api@6.5.0:
     resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==}
     resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==}
 
 
-  /@vue/language-core@1.8.1(typescript@5.1.3):
+  /@vue/language-core@1.8.1(typescript@5.1.5):
     resolution: {integrity: sha512-pumv3k4J7P58hVh4YGRM9Qz3HaAr4TlFWM9bnVOkZ/2K9o2CK1lAP2y9Jw+Z0+mNL4F2uWQqnAPzj3seLyfpDA==}
     resolution: {integrity: sha512-pumv3k4J7P58hVh4YGRM9Qz3HaAr4TlFWM9bnVOkZ/2K9o2CK1lAP2y9Jw+Z0+mNL4F2uWQqnAPzj3seLyfpDA==}
     peerDependencies:
     peerDependencies:
       typescript: '*'
       typescript: '*'
@@ -1950,7 +1950,7 @@ packages:
       '@vue/shared': 3.3.4
       '@vue/shared': 3.3.4
       minimatch: 9.0.1
       minimatch: 9.0.1
       muggle-string: 0.3.1
       muggle-string: 0.3.1
-      typescript: 5.1.3
+      typescript: 5.1.5
       vue-template-compiler: 2.7.14
       vue-template-compiler: 2.7.14
     dev: true
     dev: true
 
 
@@ -2010,11 +2010,11 @@ packages:
       vue-component-type-helpers: 1.6.5
       vue-component-type-helpers: 1.6.5
     dev: true
     dev: true
 
 
-  /@vue/typescript@1.8.1(typescript@5.1.3):
+  /@vue/typescript@1.8.1(typescript@5.1.5):
     resolution: {integrity: sha512-nQpo55j/roie8heCfqyXHnyayqD5+p4/0fzfxH4ZuHf7NSBQS791PNv7ztp2CCOjnGAiaiCMdtC9rc6oriyPUg==}
     resolution: {integrity: sha512-nQpo55j/roie8heCfqyXHnyayqD5+p4/0fzfxH4ZuHf7NSBQS791PNv7ztp2CCOjnGAiaiCMdtC9rc6oriyPUg==}
     dependencies:
     dependencies:
       '@volar/typescript': 1.7.8
       '@volar/typescript': 1.7.8
-      '@vue/language-core': 1.8.1(typescript@5.1.3)
+      '@vue/language-core': 1.8.1(typescript@5.1.5)
     transitivePeerDependencies:
     transitivePeerDependencies:
       - typescript
       - typescript
     dev: true
     dev: true
@@ -3729,7 +3729,7 @@ packages:
   /focus-trap@7.4.3:
   /focus-trap@7.4.3:
     resolution: {integrity: sha512-BgSSbK4GPnS2VbtZ50VtOv1Sti6DIkj3+LkVjiWMNjLeAp1SH1UlLx3ULu/DCu4vq5R4/uvTm+zrvsMsuYmGLg==}
     resolution: {integrity: sha512-BgSSbK4GPnS2VbtZ50VtOv1Sti6DIkj3+LkVjiWMNjLeAp1SH1UlLx3ULu/DCu4vq5R4/uvTm+zrvsMsuYmGLg==}
     dependencies:
     dependencies:
-      tabbable: 6.1.2
+      tabbable: 6.2.0
     dev: true
     dev: true
 
 
   /for-each@0.3.3:
   /for-each@0.3.3:
@@ -6274,6 +6274,15 @@ packages:
       vscode-textmate: 8.0.0
       vscode-textmate: 8.0.0
     dev: true
     dev: true
 
 
+  /shiki@0.14.3:
+    resolution: {integrity: sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==}
+    dependencies:
+      ansi-sequence-parser: 1.1.0
+      jsonc-parser: 3.2.0
+      vscode-oniguruma: 1.7.0
+      vscode-textmate: 8.0.0
+    dev: true
+
   /side-channel@1.0.4:
   /side-channel@1.0.4:
     resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
     resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
     dependencies:
     dependencies:
@@ -6574,8 +6583,8 @@ packages:
     resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
     resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
     dev: true
     dev: true
 
 
-  /tabbable@6.1.2:
-    resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==}
+  /tabbable@6.2.0:
+    resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==}
     dev: true
     dev: true
 
 
   /test-exclude@6.0.0:
   /test-exclude@6.0.0:
@@ -6725,14 +6734,14 @@ packages:
     resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==}
     resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==}
     dev: true
     dev: true
 
 
-  /tsutils@3.21.0(typescript@5.1.3):
+  /tsutils@3.21.0(typescript@5.1.5):
     resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
     resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
     engines: {node: '>= 6'}
     engines: {node: '>= 6'}
     peerDependencies:
     peerDependencies:
       typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
       typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
     dependencies:
     dependencies:
       tslib: 1.14.1
       tslib: 1.14.1
-      typescript: 5.1.3
+      typescript: 5.1.5
     dev: true
     dev: true
 
 
   /tsx@3.12.7:
   /tsx@3.12.7:
@@ -6824,8 +6833,8 @@ packages:
     hasBin: true
     hasBin: true
     dev: true
     dev: true
 
 
-  /typescript@5.1.3:
-    resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==}
+  /typescript@5.1.5:
+    resolution: {integrity: sha512-FOH+WN/DQjUvN6WgW+c4Ml3yi0PH+a/8q+kNIfRehv1wLhWONedw85iu+vQ39Wp49IzTJEsZ2lyLXpBF7mkF1g==}
     engines: {node: '>=14.17'}
     engines: {node: '>=14.17'}
     hasBin: true
     hasBin: true
     dev: true
     dev: true
@@ -7289,6 +7298,49 @@ packages:
       - universal-cookie
       - universal-cookie
     dev: true
     dev: true
 
 
+  /vitepress@1.0.0-beta.3(@algolia/client-search@4.18.0)(search-insights@2.6.0):
+    resolution: {integrity: sha512-GR5Pvr/o343NN1M4Na1shhDYZRrQbjmLq7WE0lla0H8iDPAsHE8agTHLWfu3FWx+3q2KA29sv16+0O9RQKGjlA==}
+    hasBin: true
+    dependencies:
+      '@docsearch/css': 3.5.1
+      '@docsearch/js': 3.5.1(@algolia/client-search@4.18.0)(search-insights@2.6.0)
+      '@vitejs/plugin-vue': 4.2.3(vite@4.3.9)(vue@3.3.4)
+      '@vue/devtools-api': 6.5.0
+      '@vueuse/core': 10.2.0(vue@3.3.4)
+      '@vueuse/integrations': 10.2.0(focus-trap@7.4.3)(vue@3.3.4)
+      body-scroll-lock: 4.0.0-beta.0
+      focus-trap: 7.4.3
+      mark.js: 8.11.1
+      minisearch: 6.1.0
+      shiki: 0.14.3
+      vite: 4.3.9(@types/node@20.3.1)
+      vue: 3.3.4
+    transitivePeerDependencies:
+      - '@algolia/client-search'
+      - '@types/node'
+      - '@types/react'
+      - '@vue/composition-api'
+      - async-validator
+      - axios
+      - change-case
+      - drauu
+      - fuse.js
+      - idb-keyval
+      - jwt-decode
+      - less
+      - nprogress
+      - qrcode
+      - react
+      - react-dom
+      - sass
+      - search-insights
+      - sortablejs
+      - stylus
+      - sugarss
+      - terser
+      - universal-cookie
+    dev: true
+
   /vitest@0.32.2(@vitest/ui@0.32.2)(jsdom@22.1.0):
   /vitest@0.32.2(@vitest/ui@0.32.2)(jsdom@22.1.0):
     resolution: {integrity: sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==}
     resolution: {integrity: sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==}
     engines: {node: '>=v14.18.0'}
     engines: {node: '>=v14.18.0'}
@@ -7425,16 +7477,16 @@ packages:
       he: 1.2.0
       he: 1.2.0
     dev: true
     dev: true
 
 
-  /vue-tsc@1.8.1(typescript@5.1.3):
+  /vue-tsc@1.8.1(typescript@5.1.5):
     resolution: {integrity: sha512-GxBQrcb0Qvyrj1uZqnTXQyWbXdNDRY2MTa+r7ESgjhf+WzBSdxZfkS3KD/C3WhKYG+aN8hf44Hp5Gqzb6PehAA==}
     resolution: {integrity: sha512-GxBQrcb0Qvyrj1uZqnTXQyWbXdNDRY2MTa+r7ESgjhf+WzBSdxZfkS3KD/C3WhKYG+aN8hf44Hp5Gqzb6PehAA==}
     hasBin: true
     hasBin: true
     peerDependencies:
     peerDependencies:
       typescript: '*'
       typescript: '*'
     dependencies:
     dependencies:
-      '@vue/language-core': 1.8.1(typescript@5.1.3)
-      '@vue/typescript': 1.8.1(typescript@5.1.3)
+      '@vue/language-core': 1.8.1(typescript@5.1.5)
+      '@vue/typescript': 1.8.1(typescript@5.1.5)
       semver: 7.5.2
       semver: 7.5.2
-      typescript: 5.1.3
+      typescript: 5.1.5
     dev: true
     dev: true
 
 
   /vue@3.3.4:
   /vue@3.3.4:

+ 2 - 1
src/index.ts

@@ -6,6 +6,7 @@ export * from './components'
 export * from './types'
 export * from './types'
 
 
 import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize'
 import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize'
+import templateCompilerOptions from './utils/template-compiler-options'
 
 
 export interface TresOptions {
 export interface TresOptions {
   extends?: Record<string, unknown>
   extends?: Record<string, unknown>
@@ -24,4 +25,4 @@ const plugin: TresPlugin = {
 
 
 export default plugin
 export default plugin
 
 
-export { normalizeColor, normalizeVectorFlexibleParam }
+export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions }

+ 15 - 0
src/utils/template-compiler-options.ts

@@ -0,0 +1,15 @@
+const whitelist = [
+  'TresCanvas',
+  'TresLeches',
+  'TresScene',
+]
+
+const templateCompilerOptions = {
+  template: {
+    compilerOptions: {
+      isCustomElement: (tag: string) => tag.startsWith('Tres') && !whitelist.includes(tag) || tag === 'primitive',
+    },
+  },
+};
+
+export default templateCompilerOptions