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

Further information on duplicates #255

Open
rightaway opened this issue Sep 3, 2018 · 1 comment
Open

Further information on duplicates #255

rightaway opened this issue Sep 3, 2018 · 1 comment

Comments

@rightaway
Copy link

It would be useful if there were a way to see where the duplicates files came from in the problems panel, or some notes in the output of how to address the issue. I see many entries like below but have no idea how to solve it and there's no further guidance. If I run webpack itself with --display-modules I don't see duplicate occurrences of MyComponent so I can't tell how to resolve this issue.

vue-loader/lib/index.js??vue-loader-options!/path/to/MyComponent.vue?vue&type=style&index=0&lang=css&
@ryan-roemer
Copy link
Member

ryan-roemer commented Sep 3, 2018

We're constrained in what information we can display UI-wise and not overwhelm the dashboard, real-estate-wise.

Fortunately, you can see a much more detailed information report using the CLI version of inspectpack (it's the underlying engine for webpack-dashboard. See usage at: https://github.com/FormidableLabs/inspectpack).

For example, for duplicates, you can do something like:

  1. Create a stats file object with something like (after npm install --dev webpack-stats-plugin):
// webpack.config.js of your project:

const { StatsWriterPlugin } = require("webpack-stats-plugin");

module.exports = {
  // ...
  plugins: [
    new StatsWriterPlugin({
      fields: ["assets", "modules"]
    })
  ]
};
  1. Run your normal webpack build command. This causes a stats JSON file of ${output.path}/stats.json to be written.

  2. Then install + run inspectpack CLI (after npm install -g inspectpack):

$ inspectpack --action duplicates \
  --stats PATH/TO/stats.json \
  --format text

and you'll get a more in-depth report.

There are lots more options and such from the inspectpack CLI. If you've got an open source project, just point us to it and I can see if I can create a sample report for you.

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

2 participants