razzle-plugin-swc

3.0.3 • Public • Published

razzle-plugin-swc

This package contains a plugin for using SWC with Razzle

Usage in Razzle Projects

yarn add razzle-plugin-swc --dev

With the default options

// razzle.config.js
 
module.exports = {
  plugins: ['swc'],
};

With custom options

// razzle.config.js
 
module.exports = {
  plugins: [
    {
      name: 'swc',
      options: {
        "jsc": {
          "parser": {
            "syntax": "ecmascript",
            "jsx": true,
            "dynamicImport": false,
            "numericSeparator": false,
            "classPrivateProperty": false,
            "privateMethod": false,
            "classProperty": false,
            "functionBind": false,
            "exportDefaultFrom": false,
            "exportNamespaceFrom": false,
            "decorators": false,
            "decoratorsBeforeExport": false,
            "nullishCoalescing": false,
            "importMeta": false,
            "optionalChaining": false
          }
        }
      },
    }
  ],
};

With custom options using .swcrc

// .swcrc
{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": true,
      "dynamicImport": false,
      "numericSeparator": false,
      "classPrivateProperty": false,
      "privateMethod": false,
      "classProperty": false,
      "functionBind": false,
      "exportDefaultFrom": false,
      "exportNamespaceFrom": false,
      "decorators": false,
      "decoratorsBeforeExport": false,
      "nullishCoalescing": false,
      "importMeta": false,
      "optionalChaining": false
    }
  }
}

To run the example

cd example/
NODE_ENV=development yarn install
yarn run start

Readme

Keywords

none

Package Sidebar

Install

npm i razzle-plugin-swc

Weekly Downloads

79

Version

3.0.3

License

MIT

Unpacked Size

424 kB

Total Files

21

Last publish

Collaborators

  • fivethreeo