UNPKG

@storm-stack/core

Version:

A build toolkit and runtime used by Storm Software in TypeScript applications

31 lines (28 loc) 777 B
import { __name } from './chunk-IRPJW6HH.js'; // src/lib/esbuild/vfs-plugin.ts var vfsPlugin = /* @__PURE__ */ __name((context) => { return { name: "storm-stack:virtual-file-system", setup(build) { build.onLoad({ filter: /.*/ }, async (args) => { if (args.path && context.vfs.isVirtualFile(args.path)) { const resolvedPath = context.vfs.resolvePath(args.path); if (resolvedPath) { const contents = await context.vfs.readFile(resolvedPath); if (!contents) { return; } return { contents, pluginData: args.pluginData }; } } return; }); } }; }, "vfsPlugin"); export { vfsPlugin };