Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostCSS config #171

Closed
timarney opened this issue Jul 25, 2016 · 4 comments
Closed

PostCSS config #171

timarney opened this issue Jul 25, 2016 · 4 comments

Comments

@timarney
Copy link

timarney commented Jul 25, 2016

It would be nice to be able modify or add PostCss plugins.

If there was a css config file that could be modified that sits in the src directory it could be required in the Webpack config and allow additional functionality (without ejecting) but still keep to the goals of this project.

Roughly this:

Modified Webpack config

var path = require('path');
var cssConfig = require('../src/css.config')
var webpack = require('webpack');

...

},
  postcss: function() {
    return cssConfig;
  },
  plugins: [
    new HtmlWebpackPlugin({


By default autoprefixer would be the only plugin in the file after running (create-react-app my-app).

Default css.config.js

var autoprefixer = require('autoprefixer')
module.exports = [autoprefixer]

User could add plugins as desired:

customized css.config.js

var autoprefixer = require('autoprefixer')
var postcssnested = require('postcss-nested')
module.exports = [postcssnested, autoprefixer]

I think a setup something like this would allow users to use SASS, LESS etc...

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

Hi, thanks for the suggestion.

We are not currently planning to add the ability to configure anything.
Instead, we are looking for good defaults.

There is some explanation about this in #99.

@gaearon gaearon closed this as completed Jul 25, 2016
@timarney
Copy link
Author

timarney commented Jul 26, 2016

@gaearon I understand, I'm all for the good defaults. I love the idea of keeping it simple and the eject option is great (was so happy to see that).

I guess what I'm stuck on is, if I want to add 1 plugin (i.e. https://github.com/jonathantneal/precss to give me SASS like markup ) or any of the other 200+ plugins PostCSS has, I have to eject to get it. I would rather not opt out of all the benefits one dependency etc... to make a small addon.

Good defaults but some hooks, middleware or how about a reducer ;)

The WordPress hook style is great because it's a quick install (easy for any type of user ) - but as a developer I can tweak so many things without touching the core ... and my tweaks don't opt me out of quick upgrades.

Anyway some thoughts for another version perhaps.

PS - Thanks for Redux. It's changed the way I code.

@gaearon
Copy link
Contributor

gaearon commented Jul 26, 2016

You can find some discussion on this in #78.

@mihhail-lapushkin
Copy link

A possible solution from my side:
#2032 (comment)

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants