purgecss-webpack-plugin icon indicating copy to clipboard operation
purgecss-webpack-plugin copied to clipboard

Cannot read property 'tap' of undefined

Open conspyrosy opened this issue 6 years ago • 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.

conspyrosy avatar Jan 08 '19 16:01 conspyrosy

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

jsnanigans avatar Jan 15 '19 09:01 jsnanigans