Closed9

swcメモ

makototmakotot
makototmakotot

SWC is an extensible Rust-based platform for the next generation of fast developer tools.

SWC can be used for both compilation and bundling. For compilation, it takes JavaScript / TypeScript files using modern JavaScript features and outputs valid code that is supported by all major browsers.

makototmakotot

@swc/cli → コマンドラインインターフェース
@swc/core→swcのコアAPI。transformとかparseとか

makototmakotot

babelのパッケージとswcの対応表
https://swc.rs/docs/migrating-from-babel#comparison

makototmakotot

コンパイルオプションのデフォルト値

{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false,
      "dynamicImport": false,
      "privateMethod": false,
      "functionBind": false,
      "exportDefaultFrom": false,
      "exportNamespaceFrom": false,
      "decorators": false,
      "decoratorsBeforeExport": false,
      "topLevelAwait": false,
      "importMeta": false,
      "preserveAllComments": false
    },
    "transform": null,
    "target": "es5",
    "loose": false,
    "externalHelpers": false,
    // Requires v1.2.50 or upper and requires target to be es2016 or upper.
    "keepClassNames": false
  }
}

https://swc.rs/docs/configuration/compilation

makototmakotot
このスクラップは2022/05/19にクローズされました