File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,10 @@ describe('convertTargets', () => {
274274 safari : 852224 ,
275275 } )
276276 } )
277+
278+ test ( 'supports es6 as an alias of es2015' , ( ) => {
279+ expect ( convertTargets ( 'es6' ) ) . toStrictEqual ( convertTargets ( 'es2015' ) )
280+ } )
277281} )
278282
279283describe ( 'getEmptyChunkReplacer' , ( ) => {
Original file line number Diff line number Diff line change @@ -3479,7 +3479,7 @@ const esMap: Record<number, string[]> = {
34793479 ] ,
34803480}
34813481
3482- const esRE = / e s ( \d { 4 } ) /
3482+ const esRE = / e s ( 6 | \d { 4 } ) /
34833483const versionRE = / \d /
34843484
34853485const convertTargetsCache = new Map <
@@ -3497,7 +3497,7 @@ export const convertTargets = (
34973497 const entriesWithoutES = arraify ( esbuildTarget ) . flatMap ( ( e ) => {
34983498 const match = esRE . exec ( e )
34993499 if ( ! match ) return e
3500- const year = Number ( match [ 1 ] )
3500+ const year = match [ 1 ] === '6' ? 2015 : Number ( match [ 1 ] )
35013501 if ( ! esMap [ year ] ) throw new Error ( `Unsupported target "${ e } "` )
35023502 return esMap [ year ]
35033503 } )
You can’t perform that action at this time.
0 commit comments