I have the following array variable in a Javascript file, meant to be passed to Purgecss for its whitelistPatterns option (please note that I'm specifically using it from the gulp-purgecss plugin):
var purgeWLP = [
/^carousel-item.*/,
/collapsing/,
/show/,
];
Now I want to store this and other project variables in an external .json file, meant to be accessed from various places and files; I've tried with the following code:
{
"wlp": [
"/^carousel-item.*/",
"/collapsing/",
"/show/"
]
}
But I'm experiencing errors and not getting what I expect, namely the same exact results as with the purgeWLP variable in the javascript file.
How can I correctly store an array of regex values inside a .json file and retrieve it from Javascript?