"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("node:module"),c=require("@rollup/plugin-inject"),p=require("@bangjelkoski/node-stdlib-browser"),a=require("@bangjelkoski/node-stdlib-browser/helpers/rollup/plugin"),d=require("@bangjelkoski/node-stdlib-browser/helpers/esbuild/plugin"),l=o=>o&&o.__esModule?o:{default:o},f=l(c),b=l(p),g=l(d),m=(o={})=>{const r=u.createRequire(typeof document>"u"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("index.cjs",document.baseURI).href).resolve("@bangjelkoski/node-stdlib-browser/helpers/esbuild/shim"),i={protocolImports:!0,...o};return{name:"vite-plugin-node-polyfills",config:(h,q)=>{const n=Object.entries(b.default).reduce((e,[t,s])=>(!i.protocolImports&&/^node:/.test(t)||(e[t]=s),e),{});return{build:{rollupOptions:{onwarn:(e,t)=>{a.handleCircularDependancyWarning(e,t)},plugins:[{...f.default({global:[r,"global"],process:[r,"process"],Buffer:[r,"Buffer"]})}]}},optimizeDeps:{esbuildOptions:{define:{Buffer:"Buffer",global:"global",process:"process"},inject:[r],plugins:[g.default(n),{name:"vite-plugin-node-polyfills-shims-resolver",setup(e){const t=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(`^${t}$`);e.onResolve({filter:s},()=>({external:!1,path:r}))}}]}},resolve:{alias:{...n}}}}}};exports.nodePolyfills=m; //# sourceMappingURL=index.cjs.map