Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - using stats presets from CLI #84

Closed
bigfanjs opened this issue Mar 9, 2017 · 11 comments
Closed

Feature - using stats presets from CLI #84

bigfanjs opened this issue Mar 9, 2017 · 11 comments

Comments

@bigfanjs
Copy link

bigfanjs commented Mar 9, 2017

Do you want to request a feature or report a bug?
feature Webpack CLI

What is the current behavior?
You have to create a config file to use stats presets like errors-only

What is the expected behavior?
Webpack CLI should display information using a preset just like what happens in configFiles

webpack entry.js bundle.js --stats errors-only
[0] ./entry1.js 0 bytes {0} [built]

Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.
OS: Windows 10
Node.js(v7.6.0)
Lang: JS

@evenstensberg
Copy link
Member

Could you elaborate more on expected behaviour and replace current behaviour with the actual behaviour?

@bigfanjs
Copy link
Author

bigfanjs commented Mar 10, 2017

I think the idea is pretty obvious; The stats shortcuts(errors-only, none, minimal, normal, verbose) that you've probably been using in your config files (see below) simply have to be available in the command line as well.

{
  stats: "errors-only"
}

Which outputs this:

[0] ./entry1.js 0 bytes {0} [built]

In case of this errors-only preset, if you want to achieve it through the cli, even if you could hide modules(using --hide-modules command) there still would be a hash, version and time in the output. And you would end up creating a webpack.config.js for such a straightforward configuration.

The actual behaviour has to be something like this:

webpack entry.js bundle.js --stats errors-only
[0] ./entry1.js 0 bytes {0} [built]

It's a matter of a couple lines of code.

Thank you!

@evenstensberg
Copy link
Member

We'll see what we can do :) This is not prio nr.1, so if you wanna implement this yourself, feel free! We'll be here if you want some help on where to put it.

@evenstensberg
Copy link
Member

FWIW- You should send the PR to webpack directly, as this is under bin. Planning to merge that into our bin folder later.

@bigfanjs
Copy link
Author

Oh thank you, I appreciate it. OK, I've never actually contributed to an open source project before but I would love to, and especially for Webpack. I am very good at JavaScript but I am sucks at open source contribution.

Would you please help me with the commit format and testing my work.

@evenstensberg
Copy link
Member

evenstensberg commented Mar 10, 2017

No problems! I recommend you to read a bit about stats to start of with. You can find places where webpack use stats object by globally searching the option in the webpack repo from your text editor.

I'm CCing @TheLarkInn , he can assist you with some intel on stats. If you wanna do the PR here, that's great!

We're merging this with webpack once it is done, so where you choose to make the PR is transparent. We prefer it to be in this repo if this isn't doing anything inside lib at webpack.

If you want, I'll write a Google Doc paper for you, similar to what I did over at #63. If you wanna help out on this repo in general, just do the same as mentioned in #63.

Do you want me to put up a branch for you and tell you a bit about our developer routine?

@bigfanjs
Copy link
Author

Thank so much for your time. That was extra info huh! I just cloned webpack-cli and everything seemed to be working just as expected! My changes are restricted to the bin folder. And I didn't know how to test it!

For the Google Doc Paper and the branch, no thank you. I appreciate the offer ^_____^.

Thank you again!

@evenstensberg
Copy link
Member

Just saw, great job @adeljs ! I'll review the PR tomorrow. And likewise, your time is highly appreciated! For the bin folder, there's really no way to test it without E2E, which we need to implement later :) If you want to help out more, there's various of possibilities open!

@bigfanjs
Copy link
Author

Oh thank you! I would love to help out more because I love webpack! Next time I hope I'll come up with something more serious and advanced! <3

@evenstensberg
Copy link
Member

Sweet! Just look for the "Good First Contribution Tags" and we'll do our best to help you!

@evenstensberg
Copy link
Member

Let's take this up on #85 , we will integrate E2E then proceed to look at the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants