0.1.5 • Published 5 months ago

fluentui-next-appdir-directive v0.1.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

@Fluent UI v9 NextJS AppDir router support plugin

This plugin allows the use of @fluentui/react-components and @griffel in the new NextJS@14 appDir router. The goal of this plugin is to add the "use client"; directive to all files in @fluentui/react-components and @griffel, but note it's not limited to these libraries.

Installation

# yarn
yarn add fluentui-next-appdir-directive

# npm
npm i fluentui-next-appdir-directive

Configuration for @fluentui/react-components and @griffel:

// next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    swcPlugins: [
      ["fluentui-next-appdir-directive",{
         paths: [
          "@griffel",
          "@fluentui"
          // 👇 you can add another dependency that needs the directive
          "your dependency name"
        ]
      }],
    ],
  },
};

module.exports = nextConfig;

Configuration for usage outside of NextJS

// .swcrc
{
  "jsc": {
    "experimental": {
      "plugins": [
        ["fluentui-next-appdir-directive", {
          "paths": [
            "@griffel",
            "@fluentui"
             // 👇 you can add another dependency that needs the directive
             "your dependency name"
          ]
        }]
      ]
    }
  }
}

Note: strings inside paths should only contain the scope/package name, in our case @fluentui/react-components -> @fluentui

0.1.5

5 months ago

0.1.4

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago