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 '
22import path from 'node:path'
33import type { Options } from 'tsup'
44import { defineConfig } from 'tsup'
55
6- function writeCommonJSEntry ( ) {
7- fs . writeFileSync (
6+ async function writeCommonJSEntry ( ) {
7+ await fs . writeFile (
88 path . join ( 'dist/cjs/' , 'index.js' ) ,
99 `'use strict'
1010if (process.env.NODE_ENV === 'production') {
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV === 'production') {
1717
1818const tsconfig = 'tsconfig.build.json' satisfies Options [ 'tsconfig' ]
1919
20- export default defineConfig ( ( options ) => {
20+ export default defineConfig ( ( options ) : Options [ ] => {
2121 const commonOptions : Options = {
2222 entry : {
2323 'react-redux' : 'src/index.ts' ,
@@ -97,8 +97,8 @@ export default defineConfig((options) => {
9797 outExtension : ( ) => ( { js : '.cjs' } ) ,
9898 minify : true ,
9999 onSuccess : async ( ) => {
100- writeCommonJSEntry ( )
100+ await writeCommonJSEntry ( )
101101 } ,
102102 } ,
103- ] as Options [ ]
103+ ]
104104} )
You can’t perform that action at this time.
0 commit comments