FullHuman/purgecss-webpack-plugin

Cannot read property 'tap' of undefined

Opened this issue · 1 comments

I am trying to follow the following tutorial: https://www.purgecss.com/guides/react with the bootstrap.css file.

I have create a fresh create-react-app, ejected the project and modified my webpack file to include the plugins but i'm seeing the following error when i npm run build "Cannot read property 'tap' of undefined".
I have tried nuking the whole repo, starting fresh and i end up with the same error.

Here's the only part of the webpack file i've changed for reference (apart from importing glob and purgecssplugin at the top).

plugins: [ PnpWebpackPlugin, new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]), new MiniCssExtractPlugin({ filename: "[name].css", }), new PurgecssPlugin({ paths: glob.sync(``${paths.appSrc}/**/*``, { nodir: true }), }), ], },

The backticks in the code above are single, i dont know how to escape them.

Any help is appreciated. Thanks.

Sounds like there is a bug when using the webpack api, ill look into this when I have time