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

Not loading config.path or default postcss.config.js #182

Open
leegee opened this issue Jul 11, 2019 · 4 comments
Open

Not loading config.path or default postcss.config.js #182

leegee opened this issue Jul 11, 2019 · 4 comments

Comments

@leegee
Copy link

leegee commented Jul 11, 2019

When I run postcss -c postcss.config.js, my css is processed.

When I run Rollup with this plugin, it is not:

        postcss({
            config: {
                path: __dirname + 'postcss.config.js'
            }
          })

node -v = v12.4.0
npm -v 6.9.0
OSX 10.14.5 (18F132)

    "postcss-cli": "2.6.0",
    "postcss-cssnext": "2.10.0",
    "postcss-discard-comments": "2.0.4",
    "postcss-discard-empty": "2.1.0",
    "postcss-import": "8.1.2",
    "postcss-reporter": "1.4.1",
    "rollup-plugin-postcss": "^2.0.3",


@AndreGeng
Copy link

from my side, "postcss.config.js" have been picked up(because autoprefixer plugin works correctly), but "extract: true" options is not working when configed inside "postcss.config.js". I have to pass "extract" option to rollup-plugin-postcss inside rollup.config.js like following for it to work

import postcss from "rollup-plugin-postcss"
...
plugins: {
 postcss({ extract: true })
}

@vabatta
Copy link

vabatta commented Mar 5, 2020

Same issue here; could not load postcss.config.js at all through the plugin.

@ArthurClemens
Copy link

The workaround I found is to require the config file and pass it to the plugin:

const config = require('./postcss.config.js');

...
plugins: [
  postcss(config),
]

@adjenks
Copy link

adjenks commented May 23, 2023

Broken for 4 years?

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

No branches or pull requests

5 participants