Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 1.03 KB

README.md

File metadata and controls

52 lines (41 loc) · 1.03 KB

nx-linaria

NX Linaria

npm version

A Nx Webpack plugin for enabling Linaria loader for babel projects.

Installation

Add the plugin to your workspace:

npm i -D nx-linaria @linaria/core @linaria/react @wyw-in-js/babel-preset

Compose the plugin in Webpack config:

import { composePlugins, withNx } from "@nx/webpack";
import { withReact } from "@nx/react";
import { withLinaria } from "nx-linaria";

export default composePlugins(
  withNx(),
  withReact(),
  withLinaria(),
  (config) => {
    return config;
  }
);

Include Linaria's babel preset in .babelrc:

{
  "presets": [
    [
      "@nx/react/babel",
      {
        "runtime": "automatic"
      }
    ],
    "@wyw-in-js"
  ],
  "plugins": []
}