UNPKG

tsds-build

Version:

Development stack for TypeScript libraries

1 lines 1.92 kB
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-dev-stack/packages/tsds-build/src/rolldown/config.ts"],"sourcesContent":["import path from 'path';\nimport camelcase from 'lodash.camelcase';\nimport { type Plugin, defineConfig } from 'rolldown';\nimport swc from 'ts-swc-rollup-plugin';\n\nimport { globals, input, pkg, tsconfig } from '../lib/rollingOptions';\n\nexport const moduleRegEx = /^[^.\\/]|^\\.[^.\\/]|^\\.\\.[^\\/]/;\n\nimport fs from 'fs';\nfs.writeFileSync(`${tsconfig.path}.es5`, JSON.stringify(tsconfig.config), 'utf8');\n\nexport default defineConfig({\n input,\n output: {\n file: path.join(process.cwd(), 'dist', 'umd', `${pkg.name}.cjs`),\n format: 'umd',\n sourcemap: true,\n name: camelcase(pkg.name),\n globals,\n },\n external: (module) => !!moduleRegEx.test(module),\n plugins: [swc({ tsconfig }) as unknown as Plugin],\n resolve: {\n tsconfigFilename: `${tsconfig.path}.es5`,\n },\n});\n"],"names":["moduleRegEx","fs","writeFileSync","tsconfig","path","JSON","stringify","config","defineConfig","input","output","file","join","process","cwd","pkg","name","format","sourcemap","camelcase","globals","external","module","test","plugins","swc","resolve","tsconfigFilename"],"mappings":";;;;;;;;;;;IAYA,OAcG;eAdH;;IALaA,WAAW;eAAXA;;;2DAPI;sEACK;wBACoB;wEAC1B;8BAE8B;yDAI/B;;;;;;AAFR,IAAMA,cAAc;AAG3BC,WAAE,CAACC,aAAa,CAAC,AAAC,GAAgB,OAAdC,wBAAQ,CAACC,IAAI,EAAC,SAAOC,KAAKC,SAAS,CAACH,wBAAQ,CAACI,MAAM,GAAG;IAE1E,WAAeC,IAAAA,sBAAY,EAAC;IAC1BC,OAAAA,qBAAK;IACLC,QAAQ;QACNC,MAAMP,aAAI,CAACQ,IAAI,CAACC,QAAQC,GAAG,IAAI,QAAQ,OAAO,AAAC,GAAW,OAATC,mBAAG,CAACC,IAAI,EAAC;QAC1DC,QAAQ;QACRC,WAAW;QACXF,MAAMG,IAAAA,wBAAS,EAACJ,mBAAG,CAACC,IAAI;QACxBI,SAAAA,uBAAO;IACT;IACAC,UAAU,SAACC;eAAW,CAAC,CAACtB,YAAYuB,IAAI,CAACD;;IACzCE,SAAS;QAACC,IAAAA,0BAAG,EAAC;YAAEtB,UAAAA,wBAAQ;QAAC;KAAwB;IACjDuB,SAAS;QACPC,kBAAkB,AAAC,GAAgB,OAAdxB,wBAAQ,CAACC,IAAI,EAAC;IACrC;AACF"}