I'm working on a production Preact application that also uses Webpack. In that project, trying to run preact build <args>
from an npm build script failed.
Following that, I created a minimal Preact application using npx preact-cli create default preact-test
, installed Webpack 5, and now preact build
throws the following error, which is the same one I was trying to reproduce:
Cannot find module 'webpack/lib/MultiEntryPlugin'
Require stack:
- /Users/<my name>/projects/preact-test/node_modules/babel-esm-plugin/src/index.js
- /Users/<my name>/projects/preact-test/node_modules/preact-cli/lib/lib/webpack/webpack-client-config.js
- /Users/<my name>/projects/preact-test/node_modules/preact-cli/lib/lib/webpack/run-webpack.js
- /Users/<my name>/projects/preact-test/node_modules/preact-cli/lib/commands/build.js
- /Users/<my name>/projects/preact-test/node_modules/preact-cli/lib/commands/index.js
- /Users/<my name>/projects/preact-test/node_modules/preact-cli/lib/index.js
I saw a post that Webpack 5 has deprecated this internal plugin, but that's the most useful info I've found anywhere. I would appreciate if anyone has a solution to resolving this issue.