Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Access static files (templates) #32

@hlegendre

Description

@hlegendre

Hi,

I am trying to deploy a serverless function that requires access to liquid templates.
I managed to include the static files in the bundle through the "includePath" config parameters but I am unable to get a path to them.

This is because the node process calling the handler is not in the same folder as the handler itself. Hence I cannot find a path to the handler (that I can then prefix to the path of my templates) to fs.readFile them... I tried using __dirname, but Browserify changes it while bundling to the path at the time of compilation...

Would you have any idea of how to make it work, please ?

PS: I explored the https://github.com/JohnPostlethwait/stringify way but I cannot define additional transforms to browserify in serverless-plugin-optimize, can I ?

BR,

Hugues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions