How to load assets properly #371
alexis-piquet
started this conversation in
Show and tell
Replies: 2 comments
-
How about external link from googleusercontent.com? Ho to handle it, because I'm getting an issue with Nextron configuring it in next.config.js, but Nextron comes with different settings. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@alexis-piquet Ref -> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here I would like to present to you how I manage all of my assets in my NextJs projects.
First of all you must have a directory named
public
in the root of your NextJs project like the screeshot above.As you can see under the
public
directory I've a sub directory namedassets
and it contains also sub directories namedfont
andimage
.Under the path
assets/font
I've decided to have aprimary
and asecondary
font.Under the path
assets/image
I've decided to categorized my images.After that you will create a new file named
asset.ts
under theshared
directory with the content above.And here you can find a basical usage
And Voilà!
I hope it will be usefull for you, let me know if you encounter an issue.
Beta Was this translation helpful? Give feedback.
All reactions