You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
549 B

import { Plugin } from "vite";
export default function dynamicApp(app: string): Plugin {
return {
name: "dynamicApp", // required, will show up in warnings and errors
resolveId: (id) => {
// For some reason these are different?
const productionBuildId = "src/__app__.tsx";
const devBuildId = "/src/__app__.tsx";
if (id === productionBuildId || id === devBuildId) {
return `${__dirname}/src/${app}.tsx`;
}
return null;
},
};
}