ci: update vite config, and packages

This commit is contained in:
Derrick Hammer 2023-10-09 09:14:29 -04:00
parent 0d00283ba1
commit f2f6c44803
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 28 additions and 13843 deletions

View File

@ -27,7 +27,9 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"tailwind-merge": "^1.14.0", "tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7" "tailwindcss-animate": "^1.0.7",
"vite-plugin-node-polyfills": "^0.15.0",
"vite-plugin-optimizer": "^1.4.2"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-essentials": "^7.4.6", "@storybook/addon-essentials": "^7.4.6",

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,11 @@
import { defineConfig } from "vite" import { defineConfig } from "vite";
import react from "@vitejs/plugin-react" import react from "@vitejs/plugin-react";
import scopeTailwind from "./lib/vite-plugin-scope-tailwind/src/main" //import scopeTailwind from "./lib/vite-plugin-scope-tailwind/src/main"
import { resolve } from "path" import { resolve } from "path";
import svgr from "vite-plugin-svgr" import svgr from "vite-plugin-svgr";
import dts from "vite-plugin-dts" import dts from "vite-plugin-dts";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import optimizer from "vite-plugin-optimizer";
// import css from 'rollup-plugin-css-only' // import css from 'rollup-plugin-css-only'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
@ -11,13 +13,22 @@ export default defineConfig({
plugins: [ plugins: [
svgr(), svgr(),
react(), react(),
scopeTailwind({ react: true, classNameTransformers: ["cn"] }), // scopeTailwind({ react: true, classNameTransformers: ["cn"] }),
dts({ dts({
tsconfigPath: "tsconfig.build.json" tsconfigPath: "tsconfig.build.json",
}),
optimizer({
"node-fetch":
"const e = undefined; export default e;export {e as Response, e as FormData, e as Blob};",
}),
nodePolyfills({
exclude: ["fs"],
globals: { Buffer: true, global: true, process: true },
}), }),
// css({ output: 'styles/globals.css' }) // css({ output: 'styles/globals.css' })
], ],
resolve: { resolve: {
dedupe: ["@lumeweb/libportal", "@lumeweb/libweb", "@lumeweb/libkernel"],
// TODO: For some reason aliases are not working.... // TODO: For some reason aliases are not working....
// alias: { // alias: {
// '@styles/': resolve(__dirname, './styles'), // '@styles/': resolve(__dirname, './styles'),
@ -31,10 +42,11 @@ export default defineConfig({
outDir: "dist", outDir: "dist",
emptyOutDir: true, emptyOutDir: true,
sourcemap: true, sourcemap: true,
minify: false,
lib: { lib: {
entry: resolve(__dirname, "src/main.ts"), entry: resolve(__dirname, "src/main.ts"),
name: "lume-sdk", name: "lume-sdk",
fileName: (format) => `lib.${format}.js` fileName: (format) => `lib.${format}.js`,
}, },
rollupOptions: { rollupOptions: {
external: [ external: [
@ -43,7 +55,7 @@ export default defineConfig({
// "framer-motion", // "framer-motion",
// "tailwind-merge", // "tailwind-merge",
// "class-variance-authority" // "class-variance-authority"
] ],
} },
} },
}) });