@@ -34,12 +34,17 @@ const EXPORTNAME = '__firestore_exports__';
34
34
const OUTPUT_FOLDER = 'dist' ;
35
35
const OUTPUT_FILE = 'standalone.js' ;
36
36
37
- const es5InputOptions = {
37
+ const es6InputOptions = {
38
38
input : 'src/index.console.ts' ,
39
39
plugins : [
40
40
nodeResolve ( ) ,
41
41
typescriptPlugin ( {
42
42
typescript,
43
+ tsconfigOverride : {
44
+ compilerOptions : {
45
+ target : 'es6'
46
+ }
47
+ } ,
43
48
transformers : [ rollupUtil . removeAssertTransformer ]
44
49
} ) ,
45
50
json ( { preferConst : true } ) ,
@@ -51,7 +56,7 @@ const es5InputOptions = {
51
56
]
52
57
} ;
53
58
54
- const es5OutputOptions = {
59
+ const es6OutputOptions = {
55
60
file : `${ OUTPUT_FOLDER } /${ OUTPUT_FILE } ` ,
56
61
name : EXPORTNAME ,
57
62
format : 'iife'
@@ -60,18 +65,18 @@ const es5OutputOptions = {
60
65
const POSTFIX = `window['${ EXPORTNAME } ']=${ EXPORTNAME } ;` ;
61
66
62
67
async function build ( ) {
63
- const es5Bundle = await rollup . rollup ( es5InputOptions ) ;
68
+ const es6Bundle = await rollup . rollup ( es6InputOptions ) ;
64
69
const {
65
70
output : [ { code } ]
66
- } = await es5Bundle . generate ( es5OutputOptions ) ;
71
+ } = await es6Bundle . generate ( es6OutputOptions ) ;
67
72
68
73
const output = `${ String ( code ) } ${ POSTFIX } ` ;
69
74
70
75
if ( ! fs . existsSync ( OUTPUT_FOLDER ) ) {
71
76
fs . mkdirSync ( OUTPUT_FOLDER ) ;
72
77
}
73
78
74
- await fs_writeFile ( es5OutputOptions . file , output , 'utf-8' ) ;
79
+ await fs_writeFile ( es6OutputOptions . file , output , 'utf-8' ) ;
75
80
}
76
81
77
82
build ( ) ;
0 commit comments