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

next build --stats #1226

Closed
rauchg opened this issue Feb 21, 2017 · 1 comment
Closed

next build --stats #1226

rauchg opened this issue Feb 21, 2017 · 1 comment
Assignees

Comments

@rauchg
Copy link
Member

rauchg commented Feb 21, 2017

Would produce .next/stats.json and pass the profile flags to webpack

I tried this in next.config.js:

const StatsPlugin = require("stats-webpack-plugin")

module.exports = {
  webpack (cfg) {
    if (process.env.WEBPACK_STATS) {
      cfg.profile = true
      cfg.plugins.push(
        new StatsPlugin('stats.json', {
          timings: true,
          assets: true,
          chunks: true,
          chunkModules: true,
          modules: true,
          children: true,
          cached: true,
          reasons: true
        })
      )
    }
    return cfg
  }
}

But I think we need to handle it on next since it only contained main.js and common.js, and not any of the generated pages.

Ideally I would like the webpack plugin to work out of the box though

@timneutkens
Copy link
Member

Arunoda fixed the example this week 😄

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants