Production build giving error

Hello, I'm trying to host a refine app in AWS EC2.

Did "npm run build" after setting 'outDir' to 'dist' in tsconfig.json as the 'refine start' script requires the build to be existing in the 'dist' folder. Set some path aliases ilike below n vite.config.js as Vite was throwing path unresolved errors:

'@/config': './dist/src/config/index.js',
'@/providers': './dist/src/providers/index.js',
'@/components': './dist/src/components/index.js',
'@/utilities': './dist/src/utilities/index.js',
'@/enums': './dist/src/enums/index.js'

After fixing all those kinds of errors, now Vite is showing errors like these:

"Could not resolve "./index.module.css?used" from "dist/src/components/single-element-form/index.js""

Should I copy css files like these manually to the correct paths in the dist folder? Or is it supposed to be done automatically?

Also, am I moving in the right path for deploying a Refine app for production?

UPDATE: Build was successfully completed as I used 'copyfiles' to copy the css files.

Now, when accessing the link given by Vite(http://localhost:4173/), the browser console is showing the below error and the page is blank:
' Uncaught TypeError: Failed to resolve module specifier "@/config". Relative references must start with either "/", "./", or "../". '

Can anyone please help me on this?
Was this page helpful?