razzle-plugin-swc
v3.0.3
Published
Use with Razzle
Downloads
2
Readme
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