Skip to content

Commit

Permalink
fix: base url
Browse files Browse the repository at this point in the history
  • Loading branch information
jacovinus committed Jan 31, 2024
1 parent cf14c44 commit 34952af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
6 changes: 1 addition & 5 deletions packages/main/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<React.StrictMode>
<CookiesProvider>
<Provider store={store}>
<HashRouter basename="/">
<HashRouter basename="">
<Suspense fallback={<ScreenLoader />}>
<Routes>
<Route path="/" element={<AppRoute />}>
Expand Down
14 changes: 8 additions & 6 deletions packages/main/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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: {
Expand All @@ -69,7 +72,6 @@ let configOpts = {
"prismjs",
"javascript-time-ago",
"json-markup",

],
reactDnd: ["react-dnd", "react-dnd-html5-backend"],
memoize: [
Expand Down

0 comments on commit 34952af

Please sign in to comment.