Trouble using webpack PurifyCSSPlugin


#1

I have trouble using webpack PurifyCSSPlugin with buddy. It works on my local machine.

This is how my pipeline looks like:

This is how the action looks that does not work as expected:

This is the relevant part of my webpack.prod.js file:

This is the output of the console.logs() from the webpack config file
32

To me it looks like the problem is that this function:

let Files = glob.sync([PATHS + "**/*.ss"]);

does not return anything.

console.log(PATHS) returns /buddy/hsb/public

Is npms glob-all not supported?

Can someone please help me with this.


#2

I made it work. What went wrong? I did not set the the templates directory in my webpack config correctly.
So the templates couldn’t be found.

// as the webpack config file is stored in a folder called public
// __dirname will contain public
// remove it
const basepath = __dirname.replace(new RegExp("(.*/)[^/]+$"),"$1");

// now you have the base folder of your project
// add missing parameters 
let templateBaseDirName = basepath += 'app/templates/'

// get all templates from templates dir and subfolders 
let Files = glob.sync([templateBaseDirName + "**/*.ss"]);

know it works perfect