Skip to content

Commit 91ce21d

Browse files
jonathantnealromainmenke
authored andcommitted
2.0.0
1 parent fca3f53 commit 91ce21d

File tree

5 files changed

+56
-28
lines changed

5 files changed

+56
-28
lines changed

plugins/postcss-browser-comments/.rollup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
plugins: [
1010
babel({
1111
presets: [
12-
['env', { modules: false, targets: { node: 6 } }]
12+
['@babel/env', { modules: false, targets: { node: 6 } }]
1313
]
1414
})
1515
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes to PostCSS Browser Comments
22

3+
### 2.0.0 (September 6, 2018)
4+
5+
- Update to PostCSS 7.0.2 (major)
6+
- Update to browserslist 4.1.1 (major)
7+
38
### 1.0.0 (June 15, 2018)
49

510
- Initial version

plugins/postcss-browser-comments/INSTALL.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Installing PostCSS Browser Comments
22

3-
[PostCSS Browser Comments] runs in all Node environments, with special instructions for:
3+
[PostCSS Browser Comments] runs in all Node environments, with special
4+
instructions for:
45

5-
| [Node](#node) | [Webpack](#webpack) | [Create React App](#create-react-app) | [Gulp](#gulp) | [Grunt](#grunt) |
6-
| --- | --- | --- | --- | --- |
6+
| [Node](#node) | [PostCSS CLI](#postcss-cli) | [Webpack](#webpack) | [Create React App](#create-react-app) | [Gulp](#gulp) | [Grunt](#grunt) |
7+
| --- | --- | --- | --- | --- | --- |
78

89
## Node
910

@@ -16,22 +17,42 @@ npm install postcss-browser-comments --save-dev
1617
Use [PostCSS Browser Comments] to process your CSS:
1718

1819
```js
19-
import postcssBrowserComments from 'postcss-browser-comments';
20+
const postcssBrowserComments = require('postcss-browser-comments');
2021

2122
postcssBrowserComments.process(YOUR_CSS /*, processOptions, pluginOptions */);
2223
```
2324

2425
Or use it as a [PostCSS] plugin:
2526

2627
```js
27-
import postcss from 'postcss';
28-
import postcssBrowserComments from 'postcss-browser-comments';
28+
const postcss = require('postcss');
29+
const postcssBrowserComments = require('postcss-browser-comments');
2930

3031
postcss([
3132
postcssBrowserComments(/* pluginOptions */)
3233
]).process(YOUR_CSS /*, processOptions */);
3334
```
3435

36+
## PostCSS CLI
37+
38+
Add [PostCSS CLI] to your project:
39+
40+
```bash
41+
npm install postcss-cli --save-dev
42+
```
43+
44+
Use [PostCSS Browser Comments] in your `postcss.config.js` configuration file:
45+
46+
```js
47+
const postcssBrowserComments = require('postcss-browser-comments');
48+
49+
module.exports = {
50+
plugins: [
51+
postcssBrowserComments(/* pluginOptions */)
52+
]
53+
}
54+
```
55+
3556
## Webpack
3657

3758
Add [PostCSS Loader] to your project:
@@ -43,7 +64,7 @@ npm install postcss-loader --save-dev
4364
Use [PostCSS Browser Comments] in your Webpack configuration:
4465

4566
```js
46-
import postcssBrowserComments from 'postcss-browser-comments';
67+
const postcssBrowserComments = require('postcss-browser-comments');
4768

4869
module.exports = {
4970
module: {
@@ -78,8 +99,8 @@ Use [React App Rewire PostCSS] and [PostCSS Browser Comments] in your
7899
`config-overrides.js` file:
79100

80101
```js
81-
import reactAppRewirePostcss from 'react-app-rewire-postcss';
82-
import postcssBrowserComments from 'postcss-browser-comments';
102+
const reactAppRewirePostcss = require('react-app-rewire-postcss');
103+
const postcssBrowserComments = require('postcss-browser-comments');
83104

84105
export default config => reactAppRewirePostcss(config, {
85106
plugins: () => [
@@ -99,8 +120,8 @@ npm install gulp-postcss --save-dev
99120
Use [PostCSS Browser Comments] in your Gulpfile:
100121

101122
```js
102-
import postcss from 'gulp-postcss';
103-
import postcssBrowserComments from 'postcss-browser-comments';
123+
const postcss = require('gulp-postcss');
124+
const postcssBrowserComments = require('postcss-browser-comments');
104125

105126
gulp.task('css', () => gulp.src('./src/*.css').pipe(
106127
postcss([
@@ -122,7 +143,7 @@ npm install grunt-postcss --save-dev
122143
Use [PostCSS Browser Comments] in your Gruntfile:
123144

124145
```js
125-
import postcssBrowserComments from 'postcss-browser-comments';
146+
const postcssBrowserComments = require('postcss-browser-comments');
126147

127148
grunt.loadNpmTasks('grunt-postcss');
128149

@@ -143,7 +164,8 @@ grunt.initConfig({
143164
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
144165
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
145166
[PostCSS]: https://github.com/postcss/postcss
146-
[PostCSS Loader]: https://github.com/postcss/postcss-loader
147167
[PostCSS Browser Comments]: https://github.com/csstools/postcss-browser-comments
168+
[PostCSS CLI]: https://github.com/postcss/postcss-cli
169+
[PostCSS Loader]: https://github.com/postcss/postcss-loader
148170
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
149171
[React App Rewired]: https://github.com/timarney/react-app-rewired

plugins/postcss-browser-comments/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ npm install postcss-browser-comments --save-dev
6969
Use [PostCSS Browser Comments] to process your CSS:
7070

7171
```js
72-
import postcssBrowserComments from 'postcss-browser-comments';
72+
const postcssBrowserComments = require('postcss-browser-comments');
7373

7474
postcssBrowserComments.process(YOUR_CSS /*, processOptions, pluginOptions */);
7575
```
7676

7777
Or use it as a [PostCSS] plugin:
7878

7979
```js
80-
import postcss from 'postcss';
81-
import postcssBrowserComments from 'postcss-browser-comments';
80+
const postcss = require('postcss');
81+
const postcssBrowserComments = require('postcss-browser-comments');
8282

8383
postcss([
8484
postcssBrowserComments(/* pluginOptions */)
@@ -87,8 +87,8 @@ postcss([
8787

8888
[PostCSS Browser Comments] runs in all Node environments, with special instructions for:
8989

90-
| [Node](INSTALL.md#node) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
91-
| --- | --- | --- | --- | --- |
90+
| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
91+
| --- | --- | --- | --- | --- | --- |
9292

9393
## Options
9494

plugins/postcss-browser-comments/package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-browser-comments",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Keep only the CSS you need based on comments and your browserslist",
55
"author": "Jonathan Neal <csstools@hotmail.com>",
66
"license": "CC0-1.0",
@@ -25,21 +25,22 @@
2525
"node": ">=6.0.0"
2626
},
2727
"dependencies": {
28-
"postcss": "^6.0.22"
28+
"postcss": "^7.0.2"
2929
},
3030
"peerDependencies": {
31-
"browserslist": "^3"
31+
"browserslist": "^4"
3232
},
3333
"devDependencies": {
34-
"babel-core": "^6.26.3",
35-
"babel-eslint": "^8.2.3",
36-
"babel-preset-env": "^1.7.0",
37-
"eslint": "^4.19.1",
34+
"@babel/core": "^7.0.0",
35+
"@babel/preset-env": "^7.0.0",
36+
"babel-eslint": "^9.0.0",
37+
"browserslist": "^4.1.1",
38+
"eslint": "^5.5.0",
3839
"eslint-config-dev": "^2.0.0",
3940
"postcss-tape": "^2.2.0",
4041
"pre-commit": "^1.2.2",
41-
"rollup": "^0.60.7",
42-
"rollup-plugin-babel": "^3.0.4"
42+
"rollup": "^0.65.2",
43+
"rollup-plugin-babel": "^4.0.3"
4344
},
4445
"eslintConfig": {
4546
"extends": "dev",

0 commit comments

Comments
 (0)