JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2398488
  • Score
    100M100P100Q195350F
  • License MIT

Webpack plugin for swc

Package Exports

  • swc-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (swc-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

swc-loader

This package allows transpiling JavaScript files using swc and webpack.

Installation

npm i --save-dev swc swc-loader webpack

Usage

module: {
  rules: [
    {
      test: /\.m?js$/,
      exclude: /(node_modules|bower_components)/,
      use: {
        // Use `.swcrc` to configure swc
        loader: 'swc-loader',
      }
    }
  ]
}

You can pass options to the loader by using the option property.

module: {
  rules: [
    {
      test: /\.ts$/,
      exclude: /(node_modules|bower_components)/,
      use: {
        loader: 'swc-loader',
        options: {
          jsc: {
            parser: {
              syntax: "typescript"
            }
          }
        }
      }
    }
  ]
}