1.0.0 • Published 2 years ago

@hisheng/swc-loader v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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
  }
}