pirelenito / git-revision-webpack-plugin

🏗 Webpack plugin that generates VERSION and COMMITHASH files during build
https://www.npmjs.com/package/git-revision-webpack-plugin
MIT License
358 stars 48 forks source link

Improvement/rollback: lower (or don't specify) engine.node version requirement #31

Closed renodesu closed 6 years ago

renodesu commented 6 years ago

3.x.x introduces engines.node as >=8.0.0 in package.json.

Installing git-revision-webpack-plugin with yarn throws an error when running node 6.x because of the above. This breaks a lot of production builds on servers running older Node LTS (6.x).

I ran the test and they pass with node 6.14.2, and I tested with webpack4 boilerplate (https://github.com/cvgellhorn/webpack-boilerplate) to see if I can actually get the hash in-code and it works.

Not to say these tests are empirical, but it seems like requiring node>=8 isn't needed.

Suggested fix: a) lower engines.node to 6.x (or even lower if if works) b) remove the requirement completely, as it seems to do more harm than good

pirelenito commented 6 years ago

Hi @renotoaster,

This has changed on 3.0.1. Just update and you should be fine.

I'm closing the issue, but feel free to reopen if you have any other question.

Cheers!

renodesu commented 6 years ago

Seems so in the sources, though installing it through yarn add or npm install results in 3.0.1 being installed as expected... but engines.node is still >=8.0.0.

$ cat node_modules/git-revision-webpack-plugin/package.json
//...
"version": "3.0.1",
//...
"engines": {
  "node": ">=8.0.0",
  "npm": ">=5.0.0"
},

Tried clearing my npm/yarn cache, so that should not be an issue locally. Some packageregistry magicks afoot, or did a misbuilt version end up as 3.0.1?

pirelenito commented 6 years ago

Super weird!

I just pushed a new patch 3.0.2 and the problem seems to be fixed now.

Can you try again?

renodesu commented 6 years ago

3.0.2 does indeed fix this issue, thanks!