feat(packaging): ship CommonJS builds alongside ESM for v2 packages (#2405)
This commit is contained in:
parent
2f4ad132fe
commit
f172626a8e
2 changed files with 293 additions and 117 deletions
|
|
@ -23,10 +23,17 @@
|
|||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"import": "./dist/index.mjs"
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.cts",
|
||||
"default": "./dist/index.cjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"files": [
|
||||
"dist"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import { defineConfig } from 'tsdown';
|
|||
export default defineConfig({
|
||||
failOnWarn: 'ci-only',
|
||||
entry: ['src/index.ts'],
|
||||
format: ['esm'],
|
||||
format: ['esm', 'cjs'],
|
||||
fixedExtension: true,
|
||||
outDir: 'dist',
|
||||
clean: true,
|
||||
sourcemap: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue