Buy nowGet update
  • getting started
    • Introduction
    • Quick start
    • Mock server
    • Deployment
    • Package & license
    • Setup
    • Figma
  • theme UI
    • Colors
    • Typography
    • IconsNEW
    • Shadows
    • Css vars
    • Logo
    • Layout
    • Navigation
    • Settings
  • Global
    • Styles
    • Config
    • Components overrides
  • development
    • Routing
    • Subfolder
    • Authentication
    • Environment variables
    • Api calls
    • Multi language
    • Structure
    • Clean project
    • Dependencies
    • Tailwind
    • Migrate to CRA
    • Credit assets
  • support
    • 🔵 Update
    • 🔴 Faqs & support
    • 🟣 Changelogv7.4.0
© All rights reserved.ContactHome

Subfolder

✅ Applies from v6.1.0 and above.


Vite.js
.env
VITE_ASSETS_DIR=/sub

vite.config.ts
export default defineConfig({
  base: '/sub/',
  ...
});

src/main.tsx
<BrowserRouter basename="sub">
  ...
</BrowserRouter>
 
// or
 
const router = createBrowserRouter(
  [
    {
      Component: () => (
        <App>
          <Outlet />
        </App>
      ),
      errorElement: <ErrorBoundary />,
      children: routesSection,
    },
  ],
  {
    basename: '/sub',
  }
);
Next.js
.env
NEXT_PUBLIC_ASSETS_DIR=/sub

next.config.mjs
const nextConfig = {
  basePath: '/sub',
  ...
};