Skip to content

Commit

Permalink
Remove deprecations (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
SassNinja authored Oct 14, 2021
1 parent 825a257 commit 07ece9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,23 @@ It's also possible to pass the config as object to avoid any file resolution.

## Migration

### coming from 2.x

PostCSS has been updated to 8.x (which is the minimum required version now) and is no longer packaged with this plugin but has become a peer dependency.
What does this mean for you? If you're using npm >= v7 it's automatically installed, otherwise you need to install it yourself.

```bash
npm install postcss --save-dev
```

### coming from 1.x

Both options, `combine` and `minimize`, have been removed in v2 because the plugin parses your `postcss.config.js` now and applies all subsequent plugins to the extracted files as well.

So if you have used them you simply need to install appropriate PostCSS plugins (see below for example) and add them to your PostCSS config.

```bash
npm install postcss-combine-media-query cssnano --save-dev
npm install postcss postcss-combine-media-query cssnano --save-dev
```

```javascript
Expand Down
27 changes: 1 addition & 26 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const { green, yellow } = require('kleur');
const { green } = require('kleur');
const postcss = require('postcss');
const SubsequentPlugins = require('./subsequent-plugins');

Expand All @@ -26,31 +26,6 @@ module.exports = (opts) => {
plugins.updateConfig(opts.config);
}

// Deprecation warnings
// TODO: remove in future
if (typeof opts.whitelist === 'boolean') {
console.log(
yellow('[WARNING] whitelist option is deprecated – please use extractAll')
);
if (opts.whitelist === true) {
opts.extractAll = false;
}
}
if (opts.combine) {
console.log(
yellow(
'[WARNING] combine option is deprecated – please use another plugin for this'
)
);
}
if (opts.minimize) {
console.log(
yellow(
'[WARNING] minimize option is deprecated – please use another plugin for this'
)
);
}

const media = {};

function addMedia(key, css, query) {
Expand Down

0 comments on commit 07ece9e

Please sign in to comment.