Skip to content

Commit

Permalink
feat: add envinfo as webpack-cli info command
Browse files Browse the repository at this point in the history
  • Loading branch information
tabrindle committed Mar 23, 2018
1 parent 8787043 commit 51ab19f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

**If this is a feature request, what is motivation or use case for changing the behavior?**

**Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.**
**Please paste the results of `webpack-cli info` here, and mention other relevant information such as programming language.**
3 changes: 2 additions & 1 deletion bin/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
*/
"serve",
"generate-loader",
"generate-plugin"
"generate-plugin",
"info"
];

const NON_COMPILATION_CMD = process.argv.find(arg => {
Expand Down
19 changes: 19 additions & 0 deletions lib/commands/info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

const envinfo = require("envinfo");

/**
* Prints debugging information for webpack issue reporting
*/

module.exports = function info() {
console.log(
envinfo.run({
System: ["OS", "CPU"],
Binaries: ["Node", "Yarn", "npm"],
Browsers: ["Chrome", "Firefox", "Safari"],
npmPackages: "*webpack*",
npmGlobalPackages: ["webpack", "webpack-cli"],
})
);
};
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module.exports = function initialize(command, args) {
case "generate-plugin": {
return require("./generate-plugin/index.js")();
}
case "info": {
return require("./commands/info.js")();
}
default: {
throw new Error(`Unknown command ${command} found`);
}
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"cross-spawn": "^6.0.5",
"diff": "^3.5.0",
"enhanced-resolve": "^4.0.0",
"envinfo": "^4.4.2",
"glob-all": "^3.1.0",
"global-modules": "^1.0.0",
"got": "^8.2.0",
Expand Down

0 comments on commit 51ab19f

Please sign in to comment.