@swc-node/register
Advanced tools
Comparing version 1.5.5 to 1.5.6
@@ -104,3 +104,4 @@ "use strict"; | ||
function tsCompilerOptionsToSwcConfig(options, filename) { | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
const isJsx = filename.endsWith('.tsx') || filename.endsWith('.jsx') || Boolean(options.jsx); | ||
return { | ||
@@ -110,17 +111,8 @@ target: toTsTarget((_a = options.target) !== null && _a !== void 0 ? _a : ts.ScriptTarget.ES2018), | ||
sourcemap: createSourcemapOption(options), | ||
jsx: filename.endsWith('.tsx') || filename.endsWith('.jsx') || Boolean(options.jsx), | ||
react: options.jsxFactory || options.jsxFragmentFactory || options.jsx || options.jsxImportSource | ||
? { | ||
pragma: options.jsxFactory, | ||
pragmaFrag: options.jsxFragmentFactory, | ||
importSource: options.jsxImportSource, | ||
runtime: ((_c = options.jsx) !== null && _c !== void 0 ? _c : 0) >= ts.JsxEmit.ReactJSX ? 'automatic' : 'classic', | ||
} | ||
: undefined, | ||
experimentalDecorators: (_d = options.experimentalDecorators) !== null && _d !== void 0 ? _d : false, | ||
emitDecoratorMetadata: (_e = options.emitDecoratorMetadata) !== null && _e !== void 0 ? _e : false, | ||
experimentalDecorators: (_c = options.experimentalDecorators) !== null && _c !== void 0 ? _c : false, | ||
emitDecoratorMetadata: (_d = options.emitDecoratorMetadata) !== null && _d !== void 0 ? _d : false, | ||
dynamicImport: true, | ||
esModuleInterop: (_f = options.esModuleInterop) !== null && _f !== void 0 ? _f : false, | ||
esModuleInterop: (_e = options.esModuleInterop) !== null && _e !== void 0 ? _e : false, | ||
keepClassNames: true, | ||
paths: Object.fromEntries(Object.entries((_g = options.paths) !== null && _g !== void 0 ? _g : {}).map(([aliasKey, aliasPaths]) => { | ||
paths: Object.fromEntries(Object.entries((_f = options.paths) !== null && _f !== void 0 ? _f : {}).map(([aliasKey, aliasPaths]) => { | ||
var _a; | ||
@@ -132,2 +124,23 @@ return [ | ||
})), | ||
swc: { | ||
filename, | ||
jsc: { | ||
externalHelpers: false, | ||
parser: { | ||
syntax: 'typescript', | ||
tsx: isJsx, | ||
}, | ||
transform: { | ||
react: options.jsxFactory || options.jsxFragmentFactory || options.jsx || options.jsxImportSource | ||
? { | ||
pragma: options.jsxFactory, | ||
pragmaFrag: options.jsxFragmentFactory, | ||
importSource: (_g = options.jsxImportSource) !== null && _g !== void 0 ? _g : 'react', | ||
runtime: ((_h = options.jsx) !== null && _h !== void 0 ? _h : 0) >= ts.JsxEmit.ReactJSX ? 'automatic' : 'classic', | ||
useBuiltins: true, | ||
} | ||
: undefined, | ||
}, | ||
}, | ||
}, | ||
}; | ||
@@ -134,0 +147,0 @@ } |
{ | ||
"name": "@swc-node/register", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"description": "SWC node register", | ||
@@ -43,7 +43,7 @@ "keywords": [ | ||
"@swc-node/core": "^1.9.2", | ||
"@swc-node/sourcemap-support": "^0.2.3", | ||
"@swc-node/sourcemap-support": "^0.2.4", | ||
"colorette": "^2.0.19", | ||
"debug": "^4.3.4", | ||
"pirates": "^4.0.5", | ||
"tslib": "^2.4.1" | ||
"tslib": "^2.5.0" | ||
}, | ||
@@ -55,7 +55,7 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@swc/core": "^1.3.24", | ||
"@swc/core": "^1.3.32", | ||
"@types/debug": "^4.1.7", | ||
"lodash": "^4.17.21", | ||
"sinon": "^15.0.1", | ||
"typescript": "^4.9.4" | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -75,3 +75,3 @@ "funding": { | ||
}, | ||
"gitHead": "83d5f5e771a274f854b3676307954d2d33363027" | ||
"gitHead": "18396eb465eb80dd1baccd5898186c05a3f9de75" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87891
318
Updatedtslib@^2.5.0