New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@esinx/tswc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esinx/tswc

Compile your TypeScript with tsconfig.json using swc

  • 1.2.0-2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

tswc

NPM version NPM downloads

Compile your TypeScript with tsconfig.json using swc

Changes

This version of tswc uses os.tmpdir to create files instead of path.cwd.

Install

npm install @esinx/tswc @swc/core -D
# Or Yarn
yarn add @esinx/tswc @swc/core --dev

Usage

Just change swc [...options] to tswc -- [options]. That's it! Your tsconfig.json file will be respected.

For example:

# Transpile one file and emit to stdout.
# swc FILE
tswc -- FILE

# Transpile one file and emit to `output.js`.
# swc FILE -o output.js
tswc -- FILE -o output.js

# Transpile and write output to dir
# swc DIR -d dir
tswc -- DIR -d dir

See more about how to use swc cli.

You can change your build script in "package.json" as:

"build": "tswc -- src -D dist",

Now you can run npm run build to build.

Notice

Only a subgroup of fields of tsconfig is supported currently. This is done with tsconfig-to-swcconfig. This means that some tsc features may be missing when compiling with this.

If you want to know what swc config is exactly used, you can use --debug to inspect:

tswc --debug -- [other options...]

Advanced Options

Options:
  --tsconfig <filename>  the filename of tsconfig (default: tsconfig.json)
  --debug                output the final swc config (default: false)
  -h, --help             Display this message
  -v, --version          Display version number

Keywords

FAQs

Package last updated on 02 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc