Files
upstream-tanstack-query/scripts/getTsdownConfig.js
upstream-mirror 3a013ccdfe
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s
snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:13:08 +05:00

41 lines
1.1 KiB
JavaScript

// @ts-check
/**
* @param {Object} opts - Options for building configurations.
* @param {string[]} opts.entry - The entry array.
* @returns {import('tsdown').UserConfig}
*/
export function modernConfig(opts) {
return {
entry: opts.entry,
format: ['cjs', 'esm'],
target: ['chrome91', 'firefox90', 'edge91', 'safari15', 'ios15', 'opera77'],
// Rolldown lowers private fields for browser target arrays. Keep the
// transform target at ES2022 to match the syntax that tsup emitted.
inputOptions: { transform: { target: 'es2022' } },
outDir: 'build/modern',
dts: true,
fixedExtension: false,
sourcemap: true,
clean: true,
}
}
/**
* @param {Object} opts - Options for building configurations.
* @param {string[]} opts.entry - The entry array.
* @returns {import('tsdown').UserConfig}
*/
export function legacyConfig(opts) {
return {
entry: opts.entry,
format: ['cjs', 'esm'],
target: ['es2020', 'node16'],
outDir: 'build/legacy',
dts: true,
fixedExtension: false,
sourcemap: true,
clean: true,
}
}