snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
17
scripts/getViteAliases.js
Normal file
17
scripts/getViteAliases.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// @ts-check
|
||||
|
||||
import path from 'node:path'
|
||||
import ts from 'typescript'
|
||||
|
||||
const tsconfig = ts.readConfigFile(
|
||||
path.resolve(__dirname, '..', 'tsconfig.json'),
|
||||
ts.sys.readFile,
|
||||
).config
|
||||
|
||||
export const dynamicAliases = Object.entries(
|
||||
tsconfig.compilerOptions.paths || {},
|
||||
).reduce((aliases, [key, [value]]) => {
|
||||
const aliasKey = key.replace('/*', '')
|
||||
aliases[aliasKey] = path.resolve(value.replace('/*', ''))
|
||||
return aliases
|
||||
}, /** @type {Record<string, string>} */ ({}))
|
||||
Reference in New Issue
Block a user