@hisheng/swc-loader

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @hisheng/swc-loader

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.29 kB

Total Files

4

Last publish

Collaborators

  • hisheng