Hi guys, just starting with sst. Trying to use ejs...
# help
h
Hi guys, just starting with sst. Trying to use ejs templates in a test project to send emails. But my "src/templates" folder is not included inside artifacts folder. any idea? thks
f
Hey @Henry Gomez, it seems you are trying to read file using
fs.readFileSync
.
Instead, can you try setting the esbuild loader for
ejs
files and import them in ur code? ie.
Copy code
// set loader in Function definition
{
  handler: "...",
  loader: {
    ".ejs": "binary"
  },
}
and in ur code
Copy code
import template from '../templates/partials/header.txt'
console.log(template)
Let me know if it makes sense.
h
Hi @Frank Thanks for your time and response.
This is the way I'm loading and using the ejs files. Also, using a stt.queue which I think does not have "loader" attribute in the stt.QueueProps
@Frank I ended up using copyFiles bundle function. Thanks