UNPKG

@inlang/paraglide-js

Version:

[![Inlang-ecosystem compatibility badge](https://cdn.jsdelivr.net/gh/opral/monorepo@main/inlang/assets/md-badges/inlang.svg)](https://inlang.com)

22 lines (21 loc) 638 B
export const detectBundler = async (ctx) => { const potentialViteConfigPaths = ["./vite.config.js", "./vite.config.ts"]; const viteConfigPath = await Promise.all(potentialViteConfigPaths.map(async (path) => ({ path, exists: await ctx.fs .access(path) .then(() => true) .catch(() => false), }))).then((results) => results.find((result) => result.exists)?.path); if (!viteConfigPath) { return { ...ctx, bundler: undefined, }; } return { ...ctx, bundler: "vite", configPath: viteConfigPath, }; };