Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Add Last compile and Took to the output #51

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

flashios09
Copy link

Hi @geowarin,

I added an option for dateString, took, displayLastCompile and displayTook:

const defaultOutputOptions = {
  dateString: {
    color: 'blue',
  },
  took: {
    // can be "ms" or "s"
    on: 'ms',
    // greater than 5000 ms, it will be displayed on red
    // (!) if took.on === 's' then took.red must be on seconds too
    red: 5000,
  },
  displayLastCompile: true,
  displayTook: true,
};

@timneutkens
Copy link
Collaborator

Could you add a screenshot? 👍

@flashios09
Copy link
Author

Screenshot with default options:

new FriendlyErrorsPlugin()

image

Screenshot with custom options:

new FriendlyErrorsPlugin({
    output: {
        took: {on: 's', red: 5},
    }
})

image

Screenshot for a took < output.took.red(default to 5000ms):
image

@timneutkens
Copy link
Collaborator

This is really cool 👌 What I would add to Last compile however is how long ago the last compile was:
Last compile: 2017-5-28 at 02:47:30 (2 minutes ago)

@geowarin
Copy link
Owner

This is really cool !
I agree with @timneutkens, a time ago information would be useful.

Whenever the tests pass, we'll merge it :)

@flashios09
Copy link
Author

@timneutkens what do you mean by how long the last compile was ?
2 minutes ago from what ? the first time that you do node run dev ?

@flashios09
Copy link
Author

@geowarin

Whenever the tests pass, we'll merge it :)

Can you add the tests please ?

@timneutkens
Copy link
Collaborator

timneutkens commented May 28, 2017

I just realized we'd have to clear the terminal for that 😅 maybe not a good idea 😋

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

Successfully merging this pull request may close these issues.

3 participants