Skip to content

GraxMonzo/nx-linaria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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": []
}