eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 1.06 kB
JavaScript
import{createNodeEsmCompatBannerPlugin}from"#internal/node-esm-compat-banner.js";function normalizePath(e){return e.replaceAll(`\\`,`/`)}function isNodeModulesPath(e){return normalizePath(e).split(`/`).includes(`node_modules`)}function hasPathSegments(e,t){let n=normalizePath(e).split(`/`).filter(Boolean);return n.some((e,r)=>t.every((e,t)=>n[r+t]===e))}function isCompiledVendorPath(e){return hasPathSegments(e,[`.generated`,`compiled`])||hasPathSegments(e,[`dist`,`src`,`compiled`])}function getLogFilePaths(e){if(typeof e!=`object`||!e)return[];let t=e,n=Array.isArray(t.ids)?t.ids:[];return[t.id,...n,t.loc?.file,typeof t.pluginCode==`string`?t.pluginCode:void 0].filter(e=>typeof e==`string`)}function isVendoredDependencyWarning(e){return getLogFilePaths(e).some(e=>isNodeModulesPath(e)||isCompiledVendorPath(e))}function onNitroBundlerLog(e,t,n){e===`warn`&&isVendoredDependencyWarning(t)||n(e,t)}function createNitroBundlerConfig(t){return{onLog:onNitroBundlerLog,plugins:[createNodeEsmCompatBannerPlugin(),...t]}}export{createNitroBundlerConfig};