Team-Isaac-Polito / isaac-website

Team Isaac website
0 stars 0 forks source link

Add a way to upload pictures #226

Closed GBergatto closed 4 months ago

cristinagenduso commented 4 months ago

The specified method is already in place. Please place images within the src/assets folder and import them into the desired component. For reference, an example can be found on line 10 of the index page.

cristinagenduso commented 4 months ago

Since this has come up again, I wanted to provide a clearer explanation. Currently, Vite does not support advanced dynamic imports needed for this case. Images must be imported at the start of a file using the "import" directive. Therefore, dynamic imports from JSON files are not feasible.

While there are dynamic imports, they don’t suit our needs. To improve efficiency, imports will now be in the form: "import img from '@assets/lightbulb.png'" This approach is more efficient and still functional.