vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.35k stars 1.83k forks source link

[turbopack] Unable to get the configuration of PostCSS from package.json #5369

Closed mogeko closed 5 days ago

mogeko commented 1 year ago

What version of Next.js are you using Turbopack in?

13.4.4

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

According to the document of postcss-load-config, PostCSS supports configuring it using the postcss field in package.json or a configuration file.

However, the postcss field in package.json is not working when I using PostCSS with Turbopack.

截屏2023-06-23 11 26 40

Then, I tried to create a .postcssrc.json and copied the same configuration into it, everything is in line with expectations.

截屏2023-06-23 11 33 22

Expected Behavior

Use postcss in package.json to configure PostCSS, which should get the same results as using a configuration file.

To Reproduce

  1. Create a project that uses Next.js and PostCSS, for example: Next.js + Tailwind CSS Example
  2. Removed postcss.config.js to prevent it from interfering with experiments
  3. Configure Post CSS using postcss in package.json:
    "postcss": {
     "plugins": [
       "tailwindcss",
       "autoprefixer"
     ]
    }
  4. Run Next.js with Turbopack:
    pnpm next dev --turbo

Reproduction Repo

https://github.com/mogeko/movisea

PACK-2499

long2ice commented 9 months ago

Any news?

chris-olszewski commented 5 days ago

Closing as Turbopack as moved homes