1
0
Alvaro 2 жил өмнө
parent
commit
8500c62389

+ 4 - 2
packages/cientos/src/core/Text3D.vue

@@ -1,4 +1,4 @@
-<script setup lang="ts">
+<script async setup lang="ts">
 import { TextGeometry, FontLoader } from 'three-stdlib'
 
 import { computed, useSlots } from 'vue'
@@ -57,7 +57,9 @@ const loader = new FontLoader()
 const slots = useSlots()
 
 const localText = computed(() => {
-  return props.text || slots.default()[0].children.trim() || 'TresJS'
+  if (props.text) return props.text
+  else if (slots.default) return (slots.default()[0].children as string)?.trim()
+  return 'TresJS'
 })
 
 const font = await new Promise((resolve, reject) => {

+ 2 - 2
packages/cientos/src/env.d.ts

@@ -1,6 +1,4 @@
-import { App } from 'vue'
 /// <reference types="vite/client" />
-
 declare module '*.vue' {
   import type { DefineComponent } from 'vue'
   // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
@@ -8,6 +6,8 @@ declare module '*.vue' {
   export default component
 }
 
+declare module '*.glsl' {}
+
 declare global {
   // Define the window interface, with type annotations for the properties and methods of the window object
   interface Window {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
packages/cientos/stats.html


+ 1 - 1
packages/cientos/tsconfig.json

@@ -23,5 +23,5 @@
   },
   "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "histoire.setup.ts", "histoire.setup.ts"],
   "exclude": ["dist", "node_modules", "src/**/*.cy.ts", "src/**/*.test.ts"],
-  "references": [{ "path": "./tsconfig.node.json" }, { "path": "../tres/tsconfig.json" }]
+  "references": [{ "path": "./tsconfig.node.json" }]
 }

+ 4 - 4
packages/cientos/vite.config.ts

@@ -4,7 +4,7 @@ import { defineConfig } from 'vite'
 import banner from 'vite-plugin-banner'
 import dts from 'vite-plugin-dts'
 import analyze from 'rollup-plugin-analyzer'
-/* import { visualizer } from 'rollup-plugin-visualizer' */
+import { visualizer } from 'rollup-plugin-visualizer'
 
 import { resolve } from 'pathe'
 
@@ -45,11 +45,11 @@ export default defineConfig({
     rollupOptions: {
       plugins: [
         analyze(),
-        /*     visualizer({
+        visualizer({
           gzipSize: true,
           brotliSize: true,
           open: false,
-        }), */
+        }),
       ],
       external: ['three', 'vue', '@tresjs/core'],
       output: {
@@ -57,7 +57,7 @@ export default defineConfig({
         // Provide global variables to use in the UMD build
         // for externalized deps
         globals: {
-          /*        '@tresjs/core': 'TresjsCore', */
+          '@tresjs/core': 'TresjsCore',
           three: 'Three',
           vue: 'Vue',
         },

+ 1 - 0
packages/tres/src/env.d.ts

@@ -8,3 +8,4 @@ declare module '*.vue' {
 }
 
 declare module '*.glsl' {}
+declare module '*.json' {}

+ 2 - 1
packages/tres/vite.config.ts

@@ -53,7 +53,8 @@ export default defineConfig({
     rollupOptions: {
       plugins: [
         analyze(),
-        /* visualizer({
+        /*  visualizer({
+          open: true,
           gzipSize: true,
           brotliSize: true,
         }), */

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно