A Nx Webpack plugin for enabling Linaria loader for babel projects.
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": []
}