UNPKG

vite-plugin-symfony

Version:

A Vite plugin to integrate easily Vite in your Symfony application

16 lines (11 loc) 555 B
import { StringMapping } from "~/types"; const inputRelPath2outputRelPath: StringMapping = {}; export function addIOMapping(relInputPath: string, relOutputPath: string) { inputRelPath2outputRelPath[relInputPath] = relOutputPath; } export function getOutputPath(relInputPath: string): string | undefined { return inputRelPath2outputRelPath[relInputPath]; } export function getInputPath(relOutputPath: string): string | undefined { return Object.keys(inputRelPath2outputRelPath).find((key) => inputRelPath2outputRelPath[key] === relOutputPath); }