How to insert my own script.js file into the <head>?
Unanswered
American posted this in #help-forum
AmericanOP
title
3 Replies
External scripts can be loaded using:
https://nextjs.org/docs/app/building-your-application/optimizing/scripts
https://nextjs.org/docs/app/building-your-application/optimizing/scripts
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.
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.