lundegaard / gatsby-plugin-pdf

Gatsby plugin that is able generate PDFs out of your gatsby web pages
MIT License
9 stars 8 forks source link

Handle allPages option being passed as string. #4

Open tomfordweb opened 2 years ago

tomfordweb commented 2 years ago

Hello,

Thank you for sharing this plugin. I am using Gatsby 4.12.1.

There seems to be a typecasting issue with the default value for the onPostBuild method allPages param.

This was being passed to the script as a string of "false" with this configuration. For what it's worth, omitting the allPages: false and relying on the default parameter value is broken as well without this fix.

    {
      resolve: "gatsby-plugin-pdf",
      options: {
        paths: ["/my-pdf/"],
        allPages: false,
        outputPath: "/public/exports",
      },
    },