3.0.3 • Published 5 years ago

razzle-plugin-swc v3.0.3

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

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
3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago