File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
- import fs from 'node:fs'
1
+ import fs from 'node:fs/promises '
2
2
import path from 'node:path'
3
3
import type { Options } from 'tsup'
4
4
import { defineConfig } from 'tsup'
5
5
6
- function writeCommonJSEntry ( ) {
7
- fs . writeFileSync (
6
+ async function writeCommonJSEntry ( ) {
7
+ await fs . writeFile (
8
8
path . join ( 'dist/cjs/' , 'index.js' ) ,
9
9
`'use strict'
10
10
if (process.env.NODE_ENV === 'production') {
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV === 'production') {
17
17
18
18
const tsconfig = 'tsconfig.build.json' satisfies Options [ 'tsconfig' ]
19
19
20
- export default defineConfig ( ( options ) => {
20
+ export default defineConfig ( ( options ) : Options [ ] => {
21
21
const commonOptions : Options = {
22
22
entry : {
23
23
'react-redux' : 'src/index.ts' ,
@@ -97,8 +97,8 @@ export default defineConfig((options) => {
97
97
outExtension : ( ) => ( { js : '.cjs' } ) ,
98
98
minify : true ,
99
99
onSuccess : async ( ) => {
100
- writeCommonJSEntry ( )
100
+ await writeCommonJSEntry ( )
101
101
} ,
102
102
} ,
103
- ] as Options [ ]
103
+ ]
104
104
} )
You can’t perform that action at this time.
0 commit comments