SWC plugins for Jotai.
npm install --save-dev @swc-jotai/debug-label @swc-jotai/react-refresh
The plugins can be used by themselves as well.
You can add the plugins to .swcrc
:
Then update your .swcrc
file like below:
{
"jsc": {
"experimental": {
"plugins": [
["@swc-jotai/debug-label", {}],
["@swc-jotai/react-refresh", {}]
]
}
}
}
You can use the plugins with experimental SWC plugins feature in Next.js.
module.exports = {
experimental: {
swcPlugins: [
["@swc-jotai/debug-label", {}],
["@swc-jotai/react-refresh", {}],
],
},
};
You can enable the plugins for your custom atoms. You can supply them to the plugins like below:
module.exports = {
experimental: {
swcPlugins: [
["@swc-jotai/debug-label", { atomNames: ["customAtom"] }],
["@swc-jotai/react-refresh", { atomNames: ["customAtom"] }],
],
},
};