I have a couple webpack 5.9 build warnings which are giving me some difficulty in resolving.
I have researched as best I could online to no avail. I did find this:
Webpack 5 release docs: Arrays to Sets
However, except that I understand the concepts, I have no idea how to change my config settings to resolve this. Same is true for how to switch up things to "Use new ChunkGraph API".
Any assistance is appreciated.
yarn run build
(node:90180) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: chunk.files was changed from Array to Set (using Array method 'includes' is deprecated)
(Use node --trace-deprecation ... to show where the warning was created)
(node:90180) [DEP_WEBPACK_CHUNK_MODULES_ITERABLE] DeprecationWarning: Chunk.modulesIterable: Use new ChunkGraph API
Update:
I have discovered through using:
node --trace-deprecation node_modules/webpack/bin/webpack.js --mode=development
that both of these deprecation warnings occur only when using purge-css-webpack-plugin. I am using it like so (which I learned from following: https://survivejs.com/webpack/styling/eliminating-unused-css/):
new PurgeCSSWebpackPlugin({
// paths: ALL_FILES,
paths: purgePath,
extractors: [
{
extractor: (content) =>
content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [],
extensions: ["html"],
},
],
}),
Still not sure how to resolve the warnings, but at least getting closer. Also, pondering other options to remove unused CSS....
Latest Update
For @Ashish and others who my read this: I did resolve this. However, I must apologize for not updating this topic when I did b/c now I can't remember how I did it. I believe I updated some packages in my package.json to latest. Also, I currently use purge css webpack plugin like so:
`new PurgeCSSWebpackPlugin({
paths: globAll.sync(
[
`${path.resolve(__dirname, './src')}/**/*`,
`${path.resolve(__dirname, './public')}/**/*`
],
{ nodir: true }
),
}),`