Updatd config

This commit is contained in:
Sambo Chea 2022-05-17 08:45:48 +07:00
parent d2838808b8
commit 9be02019de
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490
2 changed files with 10 additions and 7 deletions

View File

@ -46,7 +46,7 @@
"eslint-plugin-react": "^7.29.4",
"typescript": "^4.6.3",
"vite": "^2.9.9",
"vite-plugin-dts": "^1.1.1",
"vite-plugin-dts": "^1.1.1"
},
"browserslist": {
"production": [

View File

@ -1,7 +1,7 @@
import * as path from "node:path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import dts from 'vite-plugin-dts';
import dts from "vite-plugin-dts";
// https://vitejs.dev/config/
export default defineConfig({
@ -9,12 +9,12 @@ export default defineConfig({
lib: {
entry: path.resolve(__dirname, "src/lib/index.ts"),
name: "muui",
formats: ['es', 'umd'],
formats: ["es", "umd"],
fileName: (format) => `muui.${format}.js`,
},
rollupOptions: {
// externalize deps that shouldn't be bundled
external: ["react", "react-dom", "@emotion/react", "@emotion/styled", "@mui/icons-material", "@mui/material"],
external: ["react", "react-dom", "@mui/icons-material", "@mui/material"],
output: {
// Provide global variables to use in the UMD build for externalized deps
globals: {
@ -23,7 +23,10 @@ export default defineConfig({
},
},
},
plugins: [react(),dts({
insertTypesEntry: true
})],
plugins: [
react(),
dts({
insertTypesEntry: true,
}),
],
});