Files
cunningham/packages/react/vite.config.ts
Nathan Vasse be1c9d000b (react) add tokens.ts files handling
These files will be used to define the custom design tokens per components.
They are automatically aggregated by the packages/react/cunningham.ts file,
this is why handling typescript config file was important.
2023-01-11 11:01:56 +01:00

40 lines
863 B
TypeScript

import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import dts from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
build: {
emptyOutDir: true,
outDir: "dist",
sourcemap: true,
lib: {
entry: {
index: "./src/index.ts",
},
formats: ["es"],
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
},
plugins: [tsconfigPaths(), dts(), react()],
test: {
environment: "jsdom",
reporters: "verbose",
globals: true,
coverage: {
all: true,
include: ["src/**/*.{ts,tsx}"],
exclude: ["**/*.stories.tsx", "**/*.spec.tsx"],
},
},
});