Kurate/packages/ui/knip.ts
Barbara Gomes 2c6b128723
feat: rework persona creation flow and add min reputation (#262)
Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>
2023-03-25 01:18:16 +01:00

26 lines
770 B
TypeScript

import sveltePreprocess from 'svelte-preprocess'
import { preprocess, compile } from 'svelte/compiler'
import type { KnipConfig } from 'knip'
const sveltePreprocessor = sveltePreprocess()
const config: KnipConfig = {
ignore: ['**/*.d.ts'],
paths: {
// This ain't pretty, but Svelte basically does the same
'$app/*': ['node_modules/@sveltejs/kit/src/runtime/app/*'],
'$env/*': ['.svelte-kit/ambient.d.ts'],
'$lib/*': ['src/lib/*'],
},
compilers: {
svelte: async (text: string) => {
const processed = await preprocess(text, sveltePreprocessor, { filename: 'dummy.ts' })
const compiled = compile(processed.code)
return compiled.js.code
},
css: (text: string) => [...text.matchAll(/(?<=@)import[^;]+/g)].join('\n'),
},
}
export default config