Skip to content

Commit

Permalink
Update docs for Preprocessors
Browse files Browse the repository at this point in the history
Add `-D` flag for dev dependencies.
Prevent error with `require()` in `postcss.config.js` cfr [this issue](vercel/next.js#10117)
  • Loading branch information
depsimon committed Jun 16, 2021
1 parent 9eed2d2 commit 73b56f4
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/pages/docs/using-with-preprocessors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ To use it, install the plugin via npm:

```shell
# npm
npm install postcss-import
npm install -D postcss-import

# yarn
yarn add postcss-import
yarn add -D postcss-import
```

Then add it as the very first plugin in your PostCSS configuration:

```js
// postcss.config.js
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
]
plugins: {
'postcss-import': {},
tailwindcss: {},
autoprefixer: {},
}
}
```

Expand Down Expand Up @@ -136,23 +136,23 @@ To use either of these plugins, install them via npm:

```shell
# npm
npm install postcss-nested # or postcss-nesting
npm install -D postcss-nested # or postcss-nesting

# yarn
yarn add postcss-nested # or postcss-nesting
yarn add -D postcss-nested # or postcss-nesting
```

Then add them to your PostCSS configuration, somewhere after Tailwind itself but before Autoprefixer:

```js
// postcss.config.js
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('postcss-nested'), // or require('postcss-nesting')
require('autoprefixer'),
]
plugins: {
'postcss-import': {},
tailwindcss: {},
'postcss-nested': {}, // or 'postcss-nesting': {},
autoprefixer: {},
}
}
```

Expand Down Expand Up @@ -194,17 +194,17 @@ For automatically managing vendor prefixes in your CSS, you should use [Autopref
To use it, install it via npm:

```shell
npm install autoprefixer
npm install -D autoprefixer
```

Then add it to the very end of your plugin list in your PostCSS configuration:

```js
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
]
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
```

Expand Down

0 comments on commit 73b56f4

Please sign in to comment.