Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

root.tsdown.config.js

37 lines884 Bytes

1// @ts-check
2​
3/**
4 * @param {Object} opts - Options for building configurations.
5 * @param {string[]} opts.entry - The entry array.
6 * @returns {import('tsdown').UserConfig}
7 */
8export function modernConfig(opts) {
9 return {
10 entry: opts.entry,
11 format: ['cjs', 'esm'],
12 target: ['chrome91', 'firefox90', 'edge91', 'safari15', 'ios15', 'opera77'],
13 outDir: 'build/modern',
14 dts: true,
15 fixedExtension: false,
16 sourcemap: true,
17 clean: true,
18 }
20​
21/**
22 * @param {Object} opts - Options for building configurations.
23 * @param {string[]} opts.entry - The entry array.
24 * @returns {import('tsdown').UserConfig}
25 */
26export function legacyConfig(opts) {
27 return {
28 entry: opts.entry,
29 format: ['cjs', 'esm'],
30 target: ['es2020', 'node16'],
31 outDir: 'build/legacy',
32 dts: true,
33 fixedExtension: false,
34 sourcemap: true,
35 clean: true,
36 }