fix problem when required from CommonJS
This commit is contained in:
parent
f727058a3a
commit
a43f2a708c
14
build.js
14
build.js
|
@ -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({
|
||||
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue