levp / wrapper-webpack-plugin

A webpack plugin that wraps output files (chunks) with custom text or code.
91 stars 37 forks source link

webpack should in the dependencies #5

Closed yangxuanxing closed 5 years ago

yangxuanxing commented 5 years ago

In our project, we flatten all dependencies to the top node_modules folder.

image

as webpack is not in the dependencies, when excute, it cannot resolve the webpack module

image

levp commented 5 years ago

Looking at the most popular webpack plugins it seems that "most" of them have webpack as a peer dependency, unlike this plugin that doesn't have webpack listed anywhere in its dependencies (as of 2.0.0).

Having webpack as a peer dependency does seem like a reasonable thing to do, regardless of this particular issue.

@yangxuanxing Will having webpack listed in the peerDependencies of the package.json solve your problem?

levp commented 5 years ago

@yangxuanxing

webpack have been added to peerDependencies in v2.1.0.

yangxuanxing commented 5 years ago

Looking at the most popular webpack plugins it seems that "most" of them have webpack as a peer dependency, unlike this plugin that doesn't have webpack listed anywhere in its dependencies (as of 2.0.0).

Having webpack as a peer dependency does seem like a reasonable thing to do, regardless of this particular issue.

@yangxuanxing Will having webpack listed in the peerDependencies of the package.json solve your problem?

solved~ thanks for your work