Files
ts-node/transpilers/swc-experimental.js
Andrew BradleyandGitHub bd048eab44 swc transpiler and new --transpiler option to use third-party transpilers (#1160)
* WIP experimental swc compiler

* Fix optional peer dep

* wip

* properly merge all of ts onto exports object

* fix clobbering of code because swc does not append a //# sourcemap comment

* More changes:
- rename from ts-node/compilers/swc to ts-node/compiler/swc-experimental
- add @swc/wasm fallback when @swc/core is not installed or available
- expand TSCommon to include all api surface used by ts-node; use TSCommon consistently (should be extracted to a different PR)
- ts-node's compiler loading logic detects a createTypescriptCompiler function and will invoke it to get instance of compiler
- fix ts-node's sourcemap comment appender to work even when TS compiler does not append a sourcemap comment.  swc does not append such a comment

* Fix bug in swc loading to allow swc API instance to be passed to factory

* lint fixes

* Fix typo in createTypescriptCompiler function name

* Switch from hacky overloading the "compiler" config to implementing a new, dedicated custom transpiler API

* fix package.json files array and add --transpiler CLI flag

* make --transpiler imply --transpile-only and add tests

* fixes

* add missing test files

* add @swc/core dep to tests

* add some jsdoc to new transpiler api surface

* change transpiler options to be specified as "transpiler: [name, {/*options*/}]"

* fix

* cleanup comments
2021-02-27 15:36:00 -05:00

2 lines
52 B
JavaScript

module.exports = require('../dist/transpilers/swc')