73 lines
1.8 KiB
JavaScript
73 lines
1.8 KiB
JavaScript
import {defineConfig} from "vite";
|
|
import {resolve} from "path";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
lib: {
|
|
entry: resolve(__dirname,"src/index.js"),
|
|
name: "react-saas",
|
|
fileName: "react-saas"
|
|
},
|
|
rollupOptions: {
|
|
external: [
|
|
"react",
|
|
"react-dom",
|
|
"react/jsx-runtime",
|
|
"react-is",
|
|
"@emotion/react",
|
|
"@emotion/styled",
|
|
"@mui/icons-material",
|
|
"@mui/lab",
|
|
"@mui/material",
|
|
"@mui/material/styles",
|
|
"@mui/material/colors",
|
|
"@mui/x-date-pickers",
|
|
"@mui/x-date-pickers/AdapterDateFns",
|
|
"@reduxjs/toolkit",
|
|
"axios",
|
|
"date-fns/locale",
|
|
"jwt-decode",
|
|
"mui-rff",
|
|
"react-polyglot",
|
|
"react-redux",
|
|
"react-router-dom",
|
|
"object-assign",
|
|
"prop-types",
|
|
"react-final-form",
|
|
"final-form"
|
|
],
|
|
output: {
|
|
globals: {
|
|
"react": "React",
|
|
"react-dom": "ReactDOM",
|
|
"react/jsx-runtime": "ReactJSX",
|
|
"react-is": "ReactIS",
|
|
"@emotion/react": "EmotionReact",
|
|
"@emotion/styled": "EmotionStyled",
|
|
"@mui/icons-material": "MuiIconsMaterial",
|
|
"@mui/lab": "MuiLab",
|
|
"@mui/material": "MuiMaterial",
|
|
"@mui/material/styles": "MuiMaterialStyles",
|
|
"@mui/material/colors": "MuiMaterialColors",
|
|
"@mui/x-date-pickers": "MuiXDatePickers",
|
|
"@mui/x-date-pickers/AdapterDateFns": "MuiXDatePickersAdapter",
|
|
"@reduxjs/toolkit": "ReduxToolkit",
|
|
"axios": "Axios",
|
|
"date-fns/locale": "DateFNSLocale",
|
|
"jwt-decode": "JWTDecode",
|
|
"mui-rff": "MUIRFF",
|
|
"react-polyglot": "ReactPolyglot",
|
|
"react-redux": "ReactRedux",
|
|
"react-router-dom": "ReactRouterDom",
|
|
"object-assign": "ObjectAssign",
|
|
"prop-types": "PropTypes",
|
|
"react-final-form": "ReactFinalForm",
|
|
"final-form": "FinalForm"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|