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

Exclude moment dependency in plugin-check report config #225

Closed
chrispcampbell opened this issue Aug 9, 2022 · 0 comments · Fixed by #226 or #227
Closed

Exclude moment dependency in plugin-check report config #225

chrispcampbell opened this issue Aug 9, 2022 · 0 comments · Fixed by #226 or #227

Comments

@chrispcampbell
Copy link
Contributor

When using plugin-check to open a report in dev mode (in a project that uses pnpm but doesn't have the moment package available via hoisting or by other means), Vite will report an error:

The following dependencies are imported but could not be resolved:

  moment (imported by /.../foo-check-bundle/dist/foo-check-bundle.mjs)

Are they installed?

The issue is that chart.js 2.9.x treats moment as an optional dependency (uses a fail-able require at runtime), so they recommend excluding it if it's not needed.

We can change vite-config-for-report.ts and add moment to the exclude list similar to what we do for threads.js and tiny-worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant