Skip to content

pmndrs/swc-jotai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swc-jotai

SWC plugins for Jotai.

Try it out using CodeSandbox.

Install

npm install --save-dev @swc-jotai/debug-label @swc-jotai/react-refresh

The plugins can be used by themselves as well.

Usage

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", {}],
    ],
  },
};

Custom atom names

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"] }],
    ],
  },
};

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages