#Importing local custom scripts

11 messages · Page 1 of 1 (latest)

sonic lagoon
#

guys I have a question, I'm trying to import a custom scripts that I created in the same folder of my components who need that, I'm using the <Script> tag from nextjs but continously tells me that the file is not found.

vale marlinBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

pliant arch
sonic lagoon
#

cause I were more comfortable to put it in the same folder of the components it's related to

pliant arch
# sonic lagoon cause I were more comfortable to put it in the same folder of the components it'...

<Script /> is for external scripts, which mean you either (1) specify a URL pointing to that script or (2) use the entire script content as a string.

public folder is an easy way to do (1).

if you want to keep in the same folder, you need to get either the file content or the file URL when importing the script file, which means you need to write a custom webpack config to handle module resolution for this specific script file. so while it's technically doable, do you think it's worth it?

sonic lagoon
#

oh, okay

#

thank you very muchj

#

anyway, do you have some suggestions about folder management?

pliant arch
vale marlinBOT