Skip to content

Remove webpack dependency from Vite plugin or make it explicit #91

Closed

Description

Is your feature request related to a problem? Please describe:

Adding the Datadog Vite plugin to vite.config.ts in a Vite project that does not use webpack throws an error:

Error: Cannot find module 'webpack'
Require stack:
C:\my-vite-project\node_modules\@datadog\vite-plugin\dist\src\index.js
C:\my-vite-project\vite.config.ts
(...)

Can reproduce by creating a vite project with npm create vite@latest, install the datadog vite plugin with npm i @datadog/vite-plugin, add the plugin to vite.config.ts, and run npm run dev

Describe the solution you'd like:

Ideally remove the dependency, or add it to this package's dependencies so that it is installed automatically when this package is installed.

Describe alternatives you've considered:

Manually installing webpack in the project resolves the issue
Installing webpack globally does not resolve the issue

Additional context:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

enhancementNew feature or requestNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions