You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Use CSS in JS with [postcss-js](https://github.com/postcss/postcss-js) in webpack
4
+
5
+
## Installation
6
+
7
+
```sh
8
+
npm i --save-dev css-in-js-loader
9
+
```
10
+
11
+
## But [postcss-loader](https://github.com/postcss/postcss-loader) already supports postcss-js as a parser?
12
+
13
+
If you're using [babel](https://github.com/babel/babel) to process your Javascript then [postcss-loader](https://github.com/postcss/postcss-loader) only transforms `.js` files one level deep, i.e. it doesn't transform that file's imports.
14
+
15
+
## Usage and Example
16
+
17
+
Put `css-in-js` between your CSS and JS loaders. `css-in-js-loader` detects if the file is a `.js` file and converts it to CSS using [postcss-js](https://github.com/postcss/postcss-js) so you can use your CSS loaders (e.g. [postcss-loader](https://github.com/postcss/postcss-loader)) normally.
0 commit comments