Skip to content

Instantly share code, notes, and snippets.

@osamajavaid
Created September 15, 2023 05:43
Show Gist options
  • Save osamajavaid/3cbd3b65f8c39d440b6eae5331849fac to your computer and use it in GitHub Desktop.
Save osamajavaid/3cbd3b65f8c39d440b6eae5331849fac to your computer and use it in GitHub Desktop.
This file contain aliasing for reactjs folder structure and svgr package for importing svg icons as react components
import react from '@vitejs/plugin-react';
import svgr from "vite-plugin-svgr";
export default {
plugins: [react(), svgr()],
server: {
port: 8081,
},
resolve: {
alias: [
{ find: '@', replacement: '/src' },
{ find: '@routes', replacement: '/src/routes' },
{ find: '@components', replacement: '/src/components' },
{ find: '@common', replacement: '/src/components/common' },
{ find: '@pages', replacement: '/src/pages' },
{ find: '@layouts', replacement: '/src/layouts' },
{ find: '@constants', replacement: '/src/constants' },
{ find: '@assets', replacement: '/src/assets' },
{ find: '@utils', replacement: '/src/utils' },
{ find: '@styles', replacement: '/src/styles' },
// Add more aliases as needed
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment