Hishengs / swc-loader

A Alternative Webpack Loader For SWC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swc-loader

A Alternative Webpack Loader For SWC

npm

Usage

npm i @hisheng/swc-loader -D

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules)/,
        use: {
          loader: "@hisheng/swc-loader",
        }
      },
    ],
  },
};

and .swcrc

{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": true,
      "dynamicImport": false,
      "privateMethod": false,
      "functionBind": false,
      "exportDefaultFrom": false,
      "exportNamespaceFrom": false,
      "decorators": false,
      "decoratorsBeforeExport": false,
      "topLevelAwait": false,
      "importMeta": 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
  }
}

About

A Alternative Webpack Loader For SWC

License:MIT License


Languages

Language:JavaScript 100.0%