pacocoursey / next-unused

Find unused files in your Next.js projects
421 stars 15 forks source link

Dynamic imports not working properly #15

Open Kolombiken opened 3 years ago

Kolombiken commented 3 years ago

I can see that there was a previous issue with dynamic imports but that there is now a test and it appears to me that it should be working.

But when trying out unused on my project it still reports back a lot of used files as unused and the only explanation I can find is that dynamic imports are somehow not working like they should.

Here is example code of a dynamic import in my project:

const player = dynamic(() => import("../player/VideoPlayer"), {
  ssr: false,
});

And config looks like this:

  "next-unused": {
    "include": [
      "src/"
    ],
    "exclude": [
      ".test."
    ],
    "entrypoints": [
      "src/pages"
    ]
  }

Is there an issue here? Or is there anything obvious that we didn't set up correctly?

oyesaxena commented 3 months ago

Any update on this issue ? i m facing similar issue for all hook files