UNPKG

complugin-babel

Version:

complugin to compile bundles with the babel.

3 lines (2 loc) 755 B
"use strict";var r=require("@babel/core"),s=require("worker_threads");const t=new Map,e=s.isMainThread?r.transformAsync:async(s,e)=>{const n=await r.transformAsync(s,await(async s=>{if(!s)return;const{plugins:e,presets:n}=s;if(!e&&!n)return s;const o=(e?JSON.stringify(e):"")+(n?JSON.stringify(n):"");let i=t.get(o);i||t.set(o,i=r.loadPartialConfigAsync(s).then((r=>[null==r?void 0:r.options.plugins,null==r?void 0:r.options.presets])));const[a,p]=await i;return s.plugins=a,s.presets=p,s})(e));if(!n)return;const{code:o,map:i}=n;return{code:o,map:i?JSON.stringify(i):void 0}},n=()=>{};var o=Object.freeze({__proto__:null,transform:e,dispose:n});exports._transformModule=o,exports.dispose=n,exports.transform=e; //# sourceMappingURL=chunk-26359b44.js.map