why on earth.....
Unable to Access HTML Files
I am trying to create a module for sending emails using nodemailer. To do so, I want to read HTML templates from a folder. However, when I supply the path to the HTML file to ReadFileSync, I am unable to access the file when I npm install the module in my project. My understanding is that this is because file paths are relative to the working directory, not the file using the path. So I tried to use __dirname Which I then found out is undefined using Node modules. So then I tried using import.meta.url which worked when using vite dev and vite preview but not when I deploy them to firebase as import.meta.url becomes undefined.
I am using Sveltekit and Firebase
Please or to participate in this conversation.