Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/graxmonzo/nx-linaria

A Nx Webpack plugin for enabling Linaria loader for babel projects.
https://github.com/graxmonzo/nx-linaria

babel linaria nx react webpack

Last synced: 26 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# nx-linaria


NX
Linaria

[![npm version](https://img.shields.io/npm/v/nx-linaria?style=flat-square)](https://www.npmjs.com/package/nx-linaria)

> A [Nx](https://nx.dev/) Webpack plugin for enabling [Linaria](https://github.com/callstack/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:_

```ts
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`:_

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