PurgeCSS breaks when used with modules

I was unable to implement PurgeCSS with a site which uses hugo modules.

I then forked the Hyas theme and it works fine. ( its set up to run PurgeCSS in development mode and its fine) the repo is here

I then made a copy the hyas theme and split the layouts into a module (as a simple example how how I use modules). Without PurgeCSS running everything is OK. Once purgeCSS is enabled, the CSS is broken.

GitHub - powerfulwebdesign/hyas-theme - has purgecss enabled

you only need to clone to hyas-site and npm install.

you can then change the module to the following to see the site working
GitHub - powerfulwebdesign/hyas-theme-no-purge - it has purge css disabled.

Can anyone offer a suggestion as to why I am unable to implement purgecss successfully when using modules?

Does anyone know how the files are passed to hugo pipes? Aside from the example that I posed, I can only get purgeCSS to work properly if the files are not from hugo modules.