@@ -116,6 +116,8 @@ const entryPoints: EntryPointOptions[] = [
116
116
]
117
117
118
118
const esVersionMappings = {
119
+ // Don't output ES2015 - have TS convert to ES5 instead
120
+ es2015 : ts . ScriptTarget . ES5 ,
119
121
es2017 : ts . ScriptTarget . ES2017 ,
120
122
es2018 : ts . ScriptTarget . ES2018 ,
121
123
es2019 : ts . ScriptTarget . ES2019 ,
@@ -130,7 +132,7 @@ async function bundle(options: BuildOptions & EntryPointOptions) {
130
132
folder = '' ,
131
133
prefix = 'redux-toolkit' ,
132
134
name,
133
- target,
135
+ target = 'es2015' ,
134
136
entryPoint,
135
137
} = options
136
138
@@ -142,7 +144,7 @@ async function bundle(options: BuildOptions & EntryPointOptions) {
142
144
entryPoints : [ entryPoint ] ,
143
145
outfile : outputFilePath ,
144
146
write : false ,
145
- target : 'esnext' ,
147
+ target : target ,
146
148
sourcemap : 'inline' ,
147
149
bundle : true ,
148
150
format : format === 'umd' ? 'esm' : format ,
@@ -232,7 +234,11 @@ async function bundle(options: BuildOptions & EntryPointOptions) {
232
234
mapping = transformResult . map as RawSourceMap
233
235
}
234
236
235
- console . log ( 'Build artifact:' , chunk . path )
237
+ const relativePath = path . relative ( process . cwd ( ) , chunk . path )
238
+ console . log ( `Build artifact: ${ relativePath } , settings: ` , {
239
+ target,
240
+ output : ts . ScriptTarget [ esVersion ] ,
241
+ } )
236
242
await fs . writeFile ( chunk . path , code )
237
243
await fs . writeJSON ( chunk . path + '.map' , mapping )
238
244
}
0 commit comments