nx-linaria
v2.0.4
Published
A Nx Webpack plugin for enabling Linaria loader for babel projects.
Downloads
12
Maintainers
Readme
nx-linaria
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": []
}