Files
integration/packages/integration/vite.config.ts
Emmanuel Pelletier d9859f1564 first commit:
- we have a static astro website under /website. It has the
implementation docs of the homepage/gaufre templates, and it handles the
few API endpoints (the gaufre js, backgrounds, logos)
- we have a vite app under /packages/integration. It has the react
components generating the homepage and the gaufre button, and their css.
Its used to generate an npm package
2024-05-02 00:35:38 +02:00

41 lines
1.0 KiB
TypeScript

import { resolve } from "path"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import dts from "vite-plugin-dts"
/*
* this config file takes care of building the react components
*
* see vite.css-config.ts for the css files (vite doesn't handle css files very well in lib mode so we generate them differently)
* see vite.html-config.ts for the html template files (they are generated from our react components)
*/
export const reactConfig = {
plugins: [
react({
babel: {
plugins: ["@babel/plugin-syntax-import-attributes"],
},
}),
],
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "index",
fileName: "index",
},
rollupOptions: {
external: ["react", "react-dom", "react/jsx-runtime"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
},
}
export default defineConfig({
...reactConfig,
plugins: [...reactConfig.plugins, dts({ rollupTypes: true })],
})