Next.js Discord

Discord Forum

How to insert my own script.js file into the <head>?

Unanswered
American posted this in #help-forum
Open in Discord
AmericanOP
title

3 Replies

However before using external scripts, make sure to check if a nodejs alternative exists or nextjs provides a alternative.

Also if you are trying to import your own script, then you shouldn't need to add it into your head tag. You can literally import your functions and variables and stuff directly in your components.
If you are trying to import your own custom script, then i advise you to first look into how nodejs works because thats basics.