When using create-nx-workspace@latest
with the --preset=react-monorepo
option and setting Vite as the bundler, Webpack is added as a dependency for @nx/module-federation
.
#29693
Labels
Current Behavior
Webpack is added as dependency for @nx/module-federation.
this package has vulnerability from npm audit
webpack 5.0.0-alpha.0 - 5.93.0
Severity: moderate
Webpack's AutoPublicPathRuntimeModule has a DOM Clobbering Gadget that leads to XSS - GHSA-4vvj-4cpr-p986
fix available via
npm audit fix --force
Will install @nx/[email protected], which is a breaking change
node_modules/webpack
@nx/module-federation *
Depends on vulnerable versions of webpack
node_modules/@nx/module-federation
@nx/react <=0.0.0-pr-29636-e3c31b7 || >=20.2.0-beta.0
Depends on vulnerable versions of @nx/module-federation
node_modules/@nx/react
Expected Behavior
as we are using Vite as bundler , this should add @originjs/vite-plugin-federation for module federation instead of @nx/module-federation
GitHub Repo
No response
Steps to Reproduce
npx create-nx-workspace@latest react-monorepo --preset=react-monorepo
√ Application name · image-generator
√ Which bundler would you like to use? · vite
√ Test runner to use for end to end (E2E) tests · cypress
√ Default stylesheet format · scss
√ Which CI provider would you like to use? · skip
√ Would you like remote caching to make your build faster? · skip
this creates a react monorepo with Vite as bundler. but it also adds @nx/module-federation. which adds webpack as dependency which is not required for Vite bundler project
npm list webpack
-- @nx/[email protected] +-- @nx/[email protected] | +-- @module-federation/[email protected] | |
-- [email protected] deduped| +-- @module-federation/[email protected]
| | +-- @module-federation/[email protected]
| | |
-- [email protected] deduped | |
-- [email protected] deduped|
-- [email protected] |
-- [email protected]|
-- [email protected] deduped
-- [email protected]`-- [email protected] deduped
Nx Report
Failure Logs
Package Manager Version
10.7.0
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: