Skip to content

Commit

Permalink
fix problem when required from CommonJS
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify authored and fiatjaf committed Dec 23, 2023
1 parent f727058 commit a43f2a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ esbuild
format: 'esm',
packages: 'external',
})
.then(() => {
const packageJson = JSON.stringify({ type: 'module' })
fs.writeFileSync(`${__dirname}/lib/esm/package.json`, packageJson, 'utf8')

console.log('esm build success.')
})
.then(() => console.log('esm build success.'))

esbuild
.build({
Expand All @@ -42,7 +37,12 @@ esbuild
format: 'cjs',
packages: 'external',
})
.then(() => console.log('cjs build success.'))
.then(() => {
const packageJson = JSON.stringify({ type: 'commonjs' })
fs.writeFileSync(`${__dirname}/lib/cjs/package.json`, packageJson, 'utf8')

console.log('cjs build success.')
})

esbuild
.build({
Expand Down

0 comments on commit a43f2a7

Please sign in to comment.