mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-06 21:53:57 -05:00
56 lines
1.1 KiB
TypeScript
56 lines
1.1 KiB
TypeScript
import tailwindcss from "@tailwindcss/vite";
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { resolve } from "path";
|
|
import { defineConfig } from "vite";
|
|
import dts from "vite-plugin-dts";
|
|
import { peerDependencies } from "./package.json";
|
|
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
tanstackRouter({
|
|
target: "react",
|
|
autoCodeSplitting: true
|
|
}),
|
|
react(),
|
|
tailwindcss(),
|
|
dts({
|
|
include: ["lib"],
|
|
tsconfigPath: "./tsconfig.lib.json",
|
|
rollupTypes: true
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "src"),
|
|
"$": resolve(__dirname, "lib"),
|
|
"#root": resolve(__dirname)
|
|
}
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname, "lib/index.ts"),
|
|
formats: [ "cjs", "es" ],
|
|
name: "Mattrixwv Component Library"
|
|
},
|
|
rollupOptions: {
|
|
external: [
|
|
"react",
|
|
"react-dom",
|
|
"react/jsx-runtime",
|
|
...Object.keys(peerDependencies).map(dep => dep.toString())
|
|
],
|
|
output: {
|
|
globals: {
|
|
react: "React",
|
|
"react-dom": "ReactDOM"
|
|
},
|
|
manualChunks: undefined
|
|
}
|
|
}
|
|
},
|
|
publicDir: false
|
|
});
|