ts-swc-transform 2.11.8 → 2.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ var _module = /*#__PURE__*/ _interop_require_default(require("module"));
|
|
|
14
14
|
var _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
15
15
|
var _url = /*#__PURE__*/ _interop_require_default(require("url"));
|
|
16
16
|
function _instanceof(left, right) {
|
|
17
|
+
"@swc/helpers - instanceof";
|
|
17
18
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
18
19
|
return !!right[Symbol.hasInstance](left);
|
|
19
20
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/lib/prepareSWCOptions.ts"],"sourcesContent":["import type { Options } from '@swc/core';\nimport { installSync, matchesLibc } from 'install-optional';\nimport debounce from 'lodash.debounce';\nimport Module from 'module';\nimport path from 'path';\nimport url from 'url';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nimport type { TSConfig } from '../types.ts';\n\nexport interface TranspilerOptions {\n tsxOptions: Options;\n nonTsxOptions: Options;\n}\n\nconst installSyncSWC = debounce(installSync, 300, { leading: true, trailing: false });\n\nexport default function prepareSWCOptions(tsconfig: TSConfig): TranspilerOptions {\n installSyncSWC('@swc/core', `${process.platform}-${process.arch}`, { cwd: __dirname, filter: matchesLibc });\n try {\n const ts = _require('typescript');\n const swc = _require('@swc/core');\n const transpiler = _require('ts-node/transpilers/swc');\n const parsed = ts.parseJsonConfigFileContent(tsconfig.config, ts.sys, path.dirname(tsconfig.path));\n return transpiler.createSwcOptions(parsed.options, undefined, swc, 'swc');\n } catch (err) {\n console.log(`prepareSWCOptions failed: ${err instanceof Error ? err.message : String(err)}`);\n return {} as TranspilerOptions;\n }\n}\n"],"names":["prepareSWCOptions","_require","require","Module","createRequire","__dirname","path","dirname","__filename","url","fileURLToPath","installSyncSWC","debounce","installSync","leading","trailing","tsconfig","process","platform","arch","cwd","filter","matchesLibc","ts","swc","transpiler","parsed","parseJsonConfigFileContent","config","sys","createSwcOptions","options","undefined","err","console","log","Error","message","String"],"mappings":";;;;+BAmBA;;;eAAwBA;;;+BAlBiB;qEACpB;6DACF;2DACF;0DACD
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/lib/prepareSWCOptions.ts"],"sourcesContent":["import type { Options } from '@swc/core';\nimport { installSync, matchesLibc } from 'install-optional';\nimport debounce from 'lodash.debounce';\nimport Module from 'module';\nimport path from 'path';\nimport url from 'url';\n\nconst _require = typeof require === 'undefined' ? Module.createRequire(import.meta.url) : require;\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nimport type { TSConfig } from '../types.ts';\n\nexport interface TranspilerOptions {\n tsxOptions: Options;\n nonTsxOptions: Options;\n}\n\nconst installSyncSWC = debounce(installSync, 300, { leading: true, trailing: false });\n\nexport default function prepareSWCOptions(tsconfig: TSConfig): TranspilerOptions {\n installSyncSWC('@swc/core', `${process.platform}-${process.arch}`, { cwd: __dirname, filter: matchesLibc });\n try {\n const ts = _require('typescript');\n const swc = _require('@swc/core');\n const transpiler = _require('ts-node/transpilers/swc');\n const parsed = ts.parseJsonConfigFileContent(tsconfig.config, ts.sys, path.dirname(tsconfig.path));\n return transpiler.createSwcOptions(parsed.options, undefined, swc, 'swc');\n } catch (err) {\n console.log(`prepareSWCOptions failed: ${err instanceof Error ? err.message : String(err)}`);\n return {} as TranspilerOptions;\n }\n}\n"],"names":["prepareSWCOptions","_require","require","Module","createRequire","__dirname","path","dirname","__filename","url","fileURLToPath","installSyncSWC","debounce","installSync","leading","trailing","tsconfig","process","platform","arch","cwd","filter","matchesLibc","ts","swc","transpiler","parsed","parseJsonConfigFileContent","config","sys","createSwcOptions","options","undefined","err","console","log","Error","message","String"],"mappings":";;;;+BAmBA;;;eAAwBA;;;+BAlBiB;qEACpB;6DACF;2DACF;0DACD;;;;;;;;;;;;;;AAEhB,IAAMC,WAAW,OAAOC,YAAY,cAAcC,eAAM,CAACC,aAAa,CAAC,uDAAmBF;AAC1F,IAAMG,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AASlG,IAAMC,iBAAiBC,IAAAA,uBAAQ,EAACC,4BAAW,EAAE,KAAK;IAAEC,SAAS;IAAMC,UAAU;AAAM;AAEpE,SAASf,kBAAkBgB,QAAkB;IAC1DL,eAAe,aAAa,AAAC,GAAsBM,OAApBA,QAAQC,QAAQ,EAAC,KAAgB,OAAbD,QAAQE,IAAI,GAAI;QAAEC,KAAKf;QAAWgB,QAAQC,4BAAW;IAAC;IACzG,IAAI;QACF,IAAMC,KAAKtB,SAAS;QACpB,IAAMuB,MAAMvB,SAAS;QACrB,IAAMwB,aAAaxB,SAAS;QAC5B,IAAMyB,SAASH,GAAGI,0BAA0B,CAACX,SAASY,MAAM,EAAEL,GAAGM,GAAG,EAAEvB,aAAI,CAACC,OAAO,CAACS,SAASV,IAAI;QAChG,OAAOmB,WAAWK,gBAAgB,CAACJ,OAAOK,OAAO,EAAEC,WAAWR,KAAK;IACrE,EAAE,OAAOS,KAAK;QACZC,QAAQC,GAAG,CAAC,AAAC,6BAA6E,OAAjDF,AAAG,YAAHA,KAAeG,SAAQH,IAAII,OAAO,GAAGC,OAAOL;QACrF,OAAO,CAAC;IACV;AACF"}
|