var e=require("node:fs"),r=require("node:path");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,u=JSON.parse(/*#__PURE__*/t(e).default.readFileSync(/*#__PURE__*/t(r).default.resolve(process.cwd(),"package.json"),"utf-8")),i="https://esm.sh/",o={imports:Object.entries(null!=(n=null==u?void 0:u.dependencies)?n:{}).reduce(function(e,r){var t=r[0],n=r[1];return e[t]=""+i+t+"@"+n,e[t+"/"]=""+i+t+"@"+n+"/",e},{})};exports.useESMImport=function(){return{name:"use-import-map",config:function(){var e;return{build:{rollupOptions:{external:Object.keys(null!=(e=null==u?void 0:u.dependencies)?e:{})}}}},transformIndexHtml:{order:"pre",handler:function(e){return{html:e,tags:[{tag:"script",attrs:{type:"importmap"},children:JSON.stringify(o),injectTo:"head-prepend"}]}}}}}; //# sourceMappingURL=index.cjs.map