mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
15 lines
616 B
TypeScript
15 lines
616 B
TypeScript
import { fileURLToPath } from "node:url";
|
|
import type { Alias } from "vite";
|
|
|
|
const fromRoot = (path: string) =>
|
|
fileURLToPath(new URL(`../${path}`, import.meta.url));
|
|
|
|
// One list for the app build and vitest, so tests resolve imports the way the
|
|
// app does. Storybook picks it up through vite.config.js.
|
|
export const appAliases: Alias[] = [
|
|
{ find: "@", replacement: fromRoot("src") },
|
|
// Every md-editor import gets the XSS config on first load.
|
|
// tsconfig.app.json maps it too, so go-to-definition lands on the plugin.
|
|
{ find: /^md-editor-v3$/, replacement: fromRoot("src/plugins/mdeditor.ts") },
|
|
];
|