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
This commit is contained in:
Emmanuel Pelletier
2024-04-22 11:19:08 +02:00
commit d9859f1564
136 changed files with 17496 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
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 })],
})