Why absolute import is not available in Metronic v8 in React projects ?
Hello KeenThemes Team,
I hope this message finds you well. I wanted to address an issue I've encountered with your React.js template.
I have yet to find a React.js template where absolute imports are applied throughout the entire project. This absence makes updating your template from scratch quite challenging.
I'm hopeful that you will release a version with absolute imports integrated soon.
Thank you for your attention to this matter.
Hi,
Could you please provide us with more info on what you are trying to achieve?
By default, our previews are served under /metronic8/vue/demo1/
, when you deploy Metronic on your server, you should update base property up to the path on your server in file vite.config.js. If you do not have a nested folder on your server then you can set base path to /
.
You can read more about this property in the official documentation:
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Hi Aymane,
Thank you for your feedback.
We will consider enabling this in the next Metronic releases, to enable absolute imports in your project now you can add properties below to your tsconfig.json
{
"compilerOptions": {
...,
"baseUrl": "src"
},
"include": [
"src"
]
}