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

Add rspack build profiling support #414

Open
nathan-isaac opened this issue Aug 18, 2024 · 1 comment
Open

Add rspack build profiling support #414

nathan-isaac opened this issue Aug 18, 2024 · 1 comment

Comments

@nathan-isaac
Copy link

nathan-isaac commented Aug 18, 2024

Since nx is using @rspack/core we can't use add the RSPACK_PROFILE environment variable, unless I'm missing something.

https://rspack.dev/contribute/development/profiling#tracing

Could we add nx support for rspack build profiling?

@nathan-isaac
Copy link
Author

I did find that there is a rsdoctor plugin. Though, when I enable it and run the nx build command it kills the doctor server. I do see it starting up in the logs.

const { composePlugins, withNx, withReact } = require('@nx/rspack');
const { RsdoctorRspackPlugin } = require('@rsdoctor/rspack-plugin');

module.exports = composePlugins(
  withNx(),
  withReact(),
  (config) => {
    config.plugins = [
      ...config.plugins,
      process.env.RSDOCTOR && new RsdoctorRspackPlugin(),
    ].filter(Boolean);
    return config;
  },
);

I did notice that a .rsdoctor folder in the app dist folder. I was able to use the rsdoctor-cli but for some reason it doesn't include any loaders or plugins.

pnpm rsdoctor analyze --profile ./dist/apps/example-app/.rsdoctor/manifest.json
image

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

No branches or pull requests

1 participant