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

Configs (postcss.config.js) #1147

Open
michael-ciniawsky opened this issue May 5, 2018 · 5 comments
Open

Configs (postcss.config.js) #1147

michael-ciniawsky opened this issue May 5, 2018 · 5 comments
Labels

Comments

@michael-ciniawsky
Copy link

Tracking issue for including postcss-load-config (postcss.config.js) into core directly

Known 'Issues'

Perf

  • Memoize repetitive config {Function} calls
  • Consider smaller amount of supported config formats (e.g postcss.config.js,postcssrc.js && pkg.postcss)

Features

  • Config Validation
  • Global require of plugins (e.g via import-cwd|import-from|resolve-cwd|resolve-from) (PostCSS CLI)
    • ⚠️ Needs triage/tracking of future ESM support in node
    • ⚠️ plugins: <Array<Function(require)>> won't work

Refactor

  • Improve {Error} messages
    • Include config file info

ℹ️ add/remove/edit this issue 😛

@garygreen
Copy link

Any news on this? The repetivtive calls to postcss.config.js is causing 3+ minute build times for us and without it only 30 seconds or so. Is there any quick workaround we can do to memorize the information/restrict the number of repetitive calls to our config? It doesn't change at all so we don't need dynamic nature

@garygreen
Copy link

Just realised this issue is on postcss - I personally think the repetitive call memorization should live on postcss-loader - it's an issue with that loader in particular and not really to do with how you call postcss?

@ai
Copy link
Member

ai commented Jul 23, 2019

The best place to solve it is postcss-load-config. It should memorize config for minute or so.

Sorry, moving config to the core will not fix the problem. Anyway we will use the same library.

@garygreen
Copy link

Yeah it would make more sense to sit on postcss-load-config - ideally there should be an option to just allow it to require the config once and then re-use it throughout the lifetime of the loader.

Not sure I fully agree with the "memorize config for a minute or so" it's really only needed to "cache" / require the config once and then just pass that onto postcss for all subsequent calls. Doesn't sound too tricky?

@ai
Copy link
Member

ai commented Jul 23, 2019

it's really only needed to "cache" / require the config once and then just pass that onto postcss for all subsequent calls.

It could be too tricky in some systems. Caching for small period of the time could be more stable. But you should ask postcss-loader author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants