Start the React rebuild of the DWG/DXF viewer (#1). - HMDesign is a git submodule (vendor/HMDesign, main) and its packages/ui is an npm workspace, so @hm-design/ui resolves to the submodule and shares this repo's node_modules. - scripts/setup-hmdesign.mjs (postinstall) builds the package dist and points vendor/HMDesign/node_modules at ours with a junction, because HMDesign's build script reads typescript/shadcn from its own root. Nothing inside the submodule is modified. - Versions follow HMDesign (react 19.3.0, vite 8.3.0, tailwindcss 4.3.3, typescript 7.0.2) and the sample (three 0.185.1, dxf-parser 1.1.2, opentype.js 2.0.0). - CSS entry: tailwindcss + @hm-design/ui/tailwind.css (index.css). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
727 B
TypeScript
23 lines
727 B
TypeScript
import { defineConfig } from "vite"
|
|
import react from "@vitejs/plugin-react"
|
|
import tailwindcss from "@tailwindcss/vite"
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
port: 5173,
|
|
strictPort: true,
|
|
},
|
|
resolve: {
|
|
// @hm-design/ui is a linked workspace (vendor/HMDesign/packages/ui); keep one React instance.
|
|
dedupe: ["react", "react-dom"],
|
|
},
|
|
optimizeDeps: {
|
|
// Only crawl this app's entry; vendor/HMDesign carries its own HTML entries (Storybook exports).
|
|
entries: ["index.html"],
|
|
include: ["three", "dxf-parser", "opentype.js"],
|
|
},
|
|
// acadrust-dwg WASM is imported with `?url` (src/engine/viewer2d/acadrustParser.ts).
|
|
assetsInclude: ["**/*.wasm"],
|
|
})
|