Skip to content

Move @types/webpack to dependencies rather than devDependencies #127

@rdsedmundo

Description

@rdsedmundo
node_modules/clean-webpack-plugin/dist/clean-webpack-plugin.d.ts:1:33 - error TS7016: Could not find a declaration file for module 'webpack'. '/node_modules/webpack/lib/webpack.js' implicitly has an 'any' type.
  Try `npm install @types/webpack` if it exists or add a new declaration (.d.ts) file containing `declare module 'webpack';`

1 import { Compiler, Stats } from 'webpack';

I'm getting this error even though I'm not using typings on my Webpack configs at all, so it shouldn't be happening. I know I can just install the @types/webpack myself, but since the package is using it for something, it actually should be included as a dependency and installed automatically once I get the package.

From TS docs:

For that reason, we used "dependencies" and not "devDependencies", because otherwise our consumers would have needed to manually install those packages. If we had just written a command line application and not expected our package to be used as a library, we might have used devDependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions