Before you open an issue, please check if a similar issue already exists or has been closed before.
purgecss you're using, and the platform(s) you're running it onnpm run buildnew PurgecssPlugin({
paths: [path.resolve(__dirname, './dist/index.html'), ...glob.sync(path.resolve(__dirname, './src/*'))],
})
dist/ is the bundle output folder
src/ is where the React components go.
output:
...
C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:148
return chunk.mapModules(function (module) {
^
TypeError: chunk.mapModules is not a function
at files (C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:148:18)
at C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:199:90
at Array.forEach (<anonymous>)
at C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:195:39
at Array.forEach (<anonymous>)
Can you spot what could be causing this error? Thanks
Thank you for reporting this issue.
What version of webpack are you using? webpack -v
Would you be able to create a minimal repo to reproduce the bug?
I've got the same error
I've got the same error锛宮y webpack version is 3.0.0
@CanbingChen can you update webpack to the latest version 3.10 and see if the error is still present?
Please continue this thread over here https://github.com/FullHuman/purgecss-webpack-plugin/issues/11 since this is a duplicate.
@Ffloriel I've got the error after update webpack.the terminal show "illegal operation on a directory, read"
@CanbingChen this should fix your issue:
In your config of purgecss add the option { nodir: true } into glob, like this:
paths: glob.sync('${PATHS.src}/*', { nodir: true })
Most helpful comment
@CanbingChen this should fix your issue:
In your config of purgecss add the option
{ nodir: true }intoglob, like this:paths: glob.sync('${PATHS.src}/*', { nodir: true })