diff --git a/packages/main/src/main.tsx b/packages/main/src/main.tsx index 33d277c7..cfbbbe6a 100644 --- a/packages/main/src/main.tsx +++ b/packages/main/src/main.tsx @@ -31,15 +31,11 @@ const UserRoles = lazy(() => import("../views/User/UserRoles")); errorInterceptor(axios); -const base = document.createElement('base') -base.href = import.meta.env.VITE_APP_BASE_URL || "/" -document.head.insertBefore(base, document.head.firstChild) - ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + }> }> diff --git a/packages/main/vite.config.ts b/packages/main/vite.config.ts index b4bd47f4..e3fbe84b 100644 --- a/packages/main/vite.config.ts +++ b/packages/main/vite.config.ts @@ -19,13 +19,15 @@ const customTransformers = [ ignorePlugin.contextRegExp.test(id) ); }, - transform: () => 'export {}', + transform: () => "export {}", }, ]; let configOpts = { + base: "", server: {}, plugins: [ + baseUrl({ url: "", staticImports: true }), basicSsl(), react({ jsxImportSource: "@emotion/react", @@ -38,12 +40,13 @@ let configOpts = { globals: true, environment: "happy-dom", }, - optimizeDeps:{ - exclude: ['moment'], // Exclude 'moment' from automatic dependency optimization - include: ['**/*.+(js|ts)'], // Include JavaScript and TypeScript files for manual dependency optimization - customTransformers + optimizeDeps: { + exclude: ["moment"], // Exclude 'moment' from automatic dependency optimization + include: ["**/*.+(js|ts)"], // Include JavaScript and TypeScript files for manual dependency optimization + customTransformers, }, build: { + base: "", sourcemap: false, rollupOptions: { output: { @@ -69,7 +72,6 @@ let configOpts = { "prismjs", "javascript-time-ago", "json-markup", - ], reactDnd: ["react-dnd", "react-dnd-html5-backend"], memoize: [