Skip to content

Nuxt Nitro server takes 1h to build (prod, Windows) - how to debug? #26739

Closed Answered by pawelgur
pawelgur asked this question in Questions
Discussion options

You must be logged in to vote

Nitro uses rollup build programmatically, in order to debug build a custom rollup plugin with console.log's on different rollup hooks (as suggested here ) can be injected into rollup config.

Rollup perf option is a useful one, but it doesn't work out of the box with programmatic approach, thus rollup source node_modules/nitropack/dist/nitro.mjs has to be manually updated:

    // in _build function
    rollupConfig.perf = true; // enable timings
    const build2 = await rollup.rollup(rollupConfig).catch((error) => {
      nitro.logger.error(formatRollupError(error));
      throw error;
    });
    console.log(build2.getTimings()); // log perf timings

Same place can be used to inject loggi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pawelgur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant