-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rspack): should be inferred by default #29736
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit 2d5e551.
☁️ Nx Cloud last updated this comment at |
22048db
to
2d5e551
Compare
export async function setupRspackConfiguration( | ||
tree: Tree, | ||
options: NormalizedSchema<Schema>, | ||
tasks: any[] | ||
) { | ||
const { configurationGenerator } = ensurePackage('@nx/rspack', nxVersion); | ||
const rspackTask = await configurationGenerator(tree, { | ||
project: options.projectName, | ||
main: joinPathFragments( | ||
options.appProjectRoot, | ||
maybeJs( | ||
{ | ||
js: options.js, | ||
useJsx: true, | ||
}, | ||
`src/main.tsx` | ||
) | ||
), | ||
tsConfig: joinPathFragments(options.appProjectRoot, 'tsconfig.app.json'), | ||
target: 'web', | ||
newProject: true, | ||
framework: 'react', | ||
}); | ||
tasks.push(rspackTask); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone decides they dont want crystal - or their workspace already has useInferencePlugins: false
what would happen with this missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will behave the same as Webpack. This should be working unless I missed something during my tests.
This PR updates the Rspack Plugin to be inferred by default.
Currently
When you generate a project using rspack it would not be inferred and would add the executor to
project.json
.After
Generating a project using rspack will add it to inferred plugins inside
nx.json
and update therspack.config.js
to be a standard config and use Nx plugins.