diff --git a/package.json b/package.json index 68ae1529..57744818 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "size-limit": "^7.0.8", "storybook": "^8.0.9", "three": "^0.153.0", + "tslib": "^2.8.1", "typescript": "^5.6.3", "vite": "^5.4.11", "vitest": "^2.1.5" diff --git a/vite.config.ts b/vite.config.ts index ce12f6dd..be589185 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,13 +26,24 @@ export default mergeConfig( rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library - external: ["react", "react-dom"], + external: [ + "react", + "react-dom", + "@react-three/fiber", + "@react-three/drei", + "three", + "three-stdlib", + ], output: { // Provide global variables to use in the UMD build // for externalized deps globals: { react: "React", "react-dom": "ReactDOM", + "@react-three/fiber": "ReactThreeFiber", + "@react-three/drei": "ReactThreeDrei", + three: "Three", + "three-stdlib": "ThreeStdlib", }, }, },