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

Prevent vue inspect from outputting "omitted long function" #1157

Closed
Dragas opened this issue Apr 20, 2018 · 5 comments · Fixed by #1175
Closed

Prevent vue inspect from outputting "omitted long function" #1157

Dragas opened this issue Apr 20, 2018 · 5 comments · Fixed by #1175

Comments

@Dragas
Copy link

Dragas commented Apr 20, 2018

What problem does this feature solve?

I've come to an issue where I need to modify the default vue CLI webpack configuration and while trying to output it I found out that key parts (mainly transformers) are omitted for no reason at all. This can be clearly seen on lines 30-32 of @vue/cli-service/lib/commands/inspect.js as the following is defined:

      if (typeof value === 'function' && value.toString().length > 100) {
        return `function () { /!* omitted long function *!/ }`
      }

What does the proposed API look like?

An additional modifier (for example -v for --verbose) would do.

@LinusBorg
Copy link
Member

for no reason at all.

Except the reason to improve read ability for the majority of use cases...

The suggestion itself is not bad though

@LinusBorg
Copy link
Member

for no reason at all.

Except the reason to improve read ability for the majority of use cases...

The suggestion itself is not bad though.

We could accept a PR for this I think.

@Dragas
Copy link
Author

Dragas commented Apr 20, 2018 via email

@LinusBorg
Copy link
Member

LinusBorg commented Apr 20, 2018

Well, if you're fine with scrolling over hundreds of lines of code (in console or a file) from some function just to find some loader config, good for you. It would get on my nerves pretty quickly.

As I said, a --verbose flag is a nice idea, but the default should (in my opinion) the way it is.

@bhouse1273
Copy link

Why not make the hard-coded 100 a config item? 0 for the equivalent of --verbose, 100 default. That would allow control of the allowable output function size, filtering out the really long functions, but still outputting the not-so-long ones.

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

Successfully merging a pull request may close this issue.

3 participants