// Search for equal or similar files and deduplicate them in the output

// https://webpack.github.io/docs/list-of-plugins.html#dedupeplugin

new webpack.optimize.DedupePlugin(),

Breaking it down

1

2

3

4

5

6

[

...true

? 'foo'

: 'bar'

]

// ['f', 'o', 'o']

This is a bit wierd considering

1

2

+true ? '10' : '20'

// '10'

According to this logic I would have expected the number 10 not the string

1

2

+(true ? '10' : '20')

// 10

Adding parentheses around the numeric example results in a number of course

I’m guessing this is a case of javascript being cleaver, it can’t spread a boolean (the ternery condition) so it evaluates the expression first. But in the unary plus boolean example it can convert the boolean to a Numeric value and so evalutes that first and then the tenery. Maybe I’ll go read the spec a little later to find out what the deal is.