Jump to content

Processwire, Critical and Gulp


Tyssen
 Share

Recommended Posts

I'm working on a site that uses the front-end tooling set-up from https://github.com/nystudio107/craft It uses package.json for defining all the Gulp plugins and paths as described in https://nystudio107.com/blog/a-better-package-json-for-the-frontend

I've been able to convert it for use with my Processwire project but I'm a bit confused about how the Critical CSS part works and how to map URLs to templates. I've also found https://processwire-recipes.com/recipes/inline-critical-css/ which uses Grunt but again, it's not clear to me how it handles all the templates.

Has anyone got a similar set up working and would you be able to share your package.json or gulpfile?

Link to comment
Share on other sites

So I think I got it. I had to add this to package.json under globs.

        "critical": [
            { "url": "", "template": "home" },
            { "url": "url-using-this-template", "template": "basic-page" },
            { "url": "blog", "template": "blog" },
            { "url": "blog/blog-post-url", "template": "blog-item" },
            { "url": "contact", "template": "contact" }
        ],

 

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...