Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ndcunningham
Copy link
Contributor

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 the rspack.config.js to be a standard config and use Nx plugins.

@ndcunningham ndcunningham requested review from a team as code owners January 23, 2025 19:00
@ndcunningham ndcunningham requested a review from Coly010 January 23, 2025 19:00
Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 7:56pm

@ndcunningham ndcunningham self-assigned this Jan 23, 2025
Copy link

nx-cloud bot commented Jan 23, 2025

View your CI Pipeline Execution ↗ for commit 2d5e551.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 4m View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 19s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=bd35a... ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-23 20:03:43 UTC

@ndcunningham ndcunningham force-pushed the fix/rspack-inferred-by-default branch from 22048db to 2d5e551 Compare January 23, 2025 19:54
Comment on lines -28 to -53
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);
}

Copy link
Contributor

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?

Copy link
Contributor Author

@ndcunningham ndcunningham Jan 24, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants