Closed IAMtheIAM closed 7 years ago
Hi,
The check is fairly strict. It generates the validation based on your configuration entries. The error says there's something extra. It would be cool to make it tell which ones.
I replaced my glob with an actual array of absolute paths (the one I got back from glob), and it still gives the same error message. Even if I shorten it to only 1 path like this, same error:
paths: {
templates: ['C:/Source/MyProject/src/app-components/detail.template.html']
},
I don't see anything extra on it.
Hi,
Do you have an entry named templates
? Can you paste your entry configuration?
The exact check is here.
Hi. Maybe I misunderstood how to use the object. Really what I'm trying to do is this. From the old API in purifycss-webpack-plugin, I had:
basePath: helpers.paths.root,
paths: [
"/src/app-components/**/*.template.html",
"/src/app-components/**/*.component.ts",
],
So now that I'm trying to upgrade to the new api, I just want to get all the files in those two path globs. I thought I could make up any entry name but I guess not. How could I accomplish this?
If you don't want to constrain it per entry, you can pass an array of absolute paths to paths
.
Thanks, I figured it out. I had to create a glob of each path, then concat them together into 1 array.
// top of file
const templatesPath = helpers.glob.sync(helpers.path.join(helpers.paths.root, "/src/app-components/**/*.template.html"));
const componentsPath = helpers.glob.sync(helpers.path.join(helpers.paths.root, "/src/app-components/**/*.component.ts"));
// plugins
new PurifyCSSPlugin({
paths: templatesPath.concat(componentsPath),
}
It would be nice if we could just path in two globs like we could in the old API. It would keep the code a little neater.
I could accept a PR for that. I decoupled glob from the API on purpose but it could be made optional (easier to consume).
I'm getting this error:
data.paths['templates'] should NOT have additional properties at Object.apply
This is my config object for paths:
I logged the globs as I have them and they output an array of absolute paths. What am I doing wrong here?