Skip to content

Allow boolean plugins support#142

Merged
egoist merged 3 commits intoegoist:masterfrom
vinkla:boolean
Jan 22, 2019
Merged

Allow boolean plugins support#142
egoist merged 3 commits intoegoist:masterfrom
vinkla:boolean

Conversation

@vinkla
Copy link
Copy Markdown
Contributor

@vinkla vinkla commented Dec 11, 2018

Allow boolean plugins similar to how Rollup plugins work. In the Rollup plugins array you may write the following to only run a plugin for production usage:

plugins: [
  (process.env.NODE_ENV === 'production' && terser())
]

This pull request allow the same approach for PostCSS plugins:

plugins: [
  (process.env.NODE_ENV === 'production' && cssnano())
]

Example of how Rollup has implemented this feature.

@egoist egoist merged commit 57dac24 into egoist:master Jan 22, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2019

Codecov Report

Merging #142 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
+ Coverage   94.61%   94.64%   +0.02%     
==========================================
  Files           8        8              
  Lines         223      224       +1     
  Branches       77       78       +1     
==========================================
+ Hits          211      212       +1     
  Misses         12       12
Impacted Files Coverage Δ
src/index.js 98.27% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5168c12...e06d9ab. Read the comment docs.

egoist pushed a commit that referenced this pull request Jan 22, 2019
* perform minimize after extract is finished

* Allow boolean plugins support (#142)

Allow boolean plugins similar to how Rollup plugins work. In the Rollup plugins array you may write the following to only run a plugin for production usage:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && terser())
]
```

This pull request allow the same approach for PostCSS plugins:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && cssnano())
]
```

[Example of how Rollup has implemented this feature.](https://github.com/rollup/rollup/blob/f58d1e60a3da4b8470e5d56aa0caef2ecadec2b8/src/rollup/index.ts#L107)

* perform minimize after extract is finished

* tweaks
@vinkla vinkla deleted the boolean branch January 22, 2019 19:29
bung87 pushed a commit to bung87/rollup-plugin-postcss that referenced this pull request Dec 3, 2019
Allow boolean plugins similar to how Rollup plugins work. In the Rollup plugins array you may write the following to only run a plugin for production usage:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && terser())
]
```

This pull request allow the same approach for PostCSS plugins:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && cssnano())
]
```

[Example of how Rollup has implemented this feature.](https://github.com/rollup/rollup/blob/f58d1e60a3da4b8470e5d56aa0caef2ecadec2b8/src/rollup/index.ts#L107)
bung87 pushed a commit to bung87/rollup-plugin-postcss that referenced this pull request Dec 3, 2019
* perform minimize after extract is finished

* Allow boolean plugins support (egoist#142)

Allow boolean plugins similar to how Rollup plugins work. In the Rollup plugins array you may write the following to only run a plugin for production usage:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && terser())
]
```

This pull request allow the same approach for PostCSS plugins:

```js
plugins: [
  (process.env.NODE_ENV === 'production' && cssnano())
]
```

[Example of how Rollup has implemented this feature.](https://github.com/rollup/rollup/blob/f58d1e60a3da4b8470e5d56aa0caef2ecadec2b8/src/rollup/index.ts#L107)

* perform minimize after extract is finished

* tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants