friendly-errors-webpack-plugin icon indicating copy to clipboard operation
friendly-errors-webpack-plugin copied to clipboard

Add `Last compile` and `Took` to the output

Open flashios09 opened this issue 7 years ago • 7 comments

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,
};

flashios09 avatar May 26 '17 23:05 flashios09

Could you add a screenshot? 👍

timneutkens avatar May 27 '17 11:05 timneutkens

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

flashios09 avatar May 28 '17 01:05 flashios09

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)

timneutkens avatar May 28 '17 08:05 timneutkens

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

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

geowarin avatar May 28 '17 08:05 geowarin

@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 avatar May 28 '17 10:05 flashios09

@geowarin

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

Can you add the tests please ?

flashios09 avatar May 28 '17 10:05 flashios09

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

timneutkens avatar May 28 '17 10:05 timneutkens