vite-plugin-zephyr
Version:
Vite plugin for Zephyr
30 lines (29 loc) • 1.17 kB
JavaScript
import { basename, resolve } from "node:path";
import { readDirRecursiveWithContents } from "zephyr-agent";
import { normalizeFilesystemVitePath, normalizeVitePath } from "../utils/normalize-vite-path.mjs";
async function load_static_entries(props) {
const root_dist_dir = resolve(props.root, props.outDir);
const files = 'tap-app' === props.target ? await readDirRecursiveWithContents(root_dist_dir, {
includeIgnoredPaths: true,
failOnError: true
}) : await readDirRecursiveWithContents(root_dist_dir);
return files.map((file)=>{
const fileName = basename(file.fullPath);
return {
fileName: 'tap-app' === props.target ? normalizeFilesystemVitePath(file.relativePath) : normalizeVitePath(file.relativePath),
name: fileName,
names: [
fileName
],
needsCodeReference: false,
source: file.content,
type: 'asset',
originalFileName: fileName,
originalFileNames: [
fileName
]
};
});
}
export { load_static_entries };
//# sourceMappingURL=load_static_entries.mjs.map