I´m a newbie on react and gatsby but i´m working on a little project as practice anda I have a little problem. I want to add a custom JS file to the project (little functions for a calculator on the index). I used Helmet to import them and on develop enviroment is working fine, but once build, is not.
import Helmet from "react-helmet"
import { withPrefix, Link } from "gatsby"
export default function homePage() {
return (
<main>
<Helmet>
<script src={withPrefix('/functions.js')} type="text/javascript" />
<script src={withPrefix('/escritura.js')} type="text/javascript" />
</Helmet>
}
I´m not sure what I am doing wrong. Someone can help me, please? You can see the project proof version live here:
https://modest-hoover-aac2d1.netlify.app/
In the final version, every input should be filled automatically, but is not happening.