@voteymcvotefaceuk There is a way to handle this for both path resolution to be the same and get your assets into your function.
- Put your function into a sub-directory under the folder you specified in your
netlify.toml(i.e pdf-read.js would be put to `functions/pdf-read/pdf-read.js).
- Include the assets in the
- Change your path with require.resolve
const contents = fs.readFileSync(require.resolve('./dummy.pdf'))
Working example in this repository to read a
.txt file in the function under
Note: Remember, this is the target functions directory, not a source directory prior to a build. The example does not do a webpack functions build using