turbo icon indicating copy to clipboard operation
turbo copied to clipboard

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

Open mogeko opened this issue 2 years ago • 1 comments

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

mogeko avatar Jun 23 '23 09:06 mogeko

Any news?

long2ice avatar Jan 20 '24 02:01 long2ice