webpack-contrib/install-webpack-plugin

Double-save to Install

ericclemmons opened this issue ยท 2 comments

The cynics have no problem killing processes, restarting servers, & having a crappy workflow to npm install dependencies, but have a problem with maybe accidentally installing a dependency because they've carelessly typo-d lodsh. ๐Ÿ‘€

Anyway, I think it'd be legit if:

  1. First save with a missing dependency threw an error (before Webpack got to it!) saying the dependency is missing. Heck, copying the error format could be useful?
  2. The second time saving the file (dunno if plugins will still fire knowing nothing has changed!) would save & install the dep.
Whoa there! `lodash` hasn't been installed yet!
Save your file again to install `lodash` automatically...

@insin I think this would help resolve some of my personal paint-points with this project. What do you think?

insin commented

Can you detect which specific file changes triggered a rebuild?

If the problem is typos, it could get kind of annoying when you haven't made one.

How about an option to ping npm to check if a module a) exists and if possible b) isn't typosquatting? (auto-install uses number of downloads in the last month for this when you use its --secure flag) before going back to the user for a double-save "are you sure"?

(So hardcoding a check for boostrap)