webpack-contrib / postcss-loader

PostCSS loader for webpack
MIT License
2.86k stars 211 forks source link

Support for TypeScript based configs, eg `postcss.config.ts` #631

Closed xeho91 closed 1 year ago

xeho91 commented 1 year ago

Modification Proposal

Add patterns to search for TypeScript extensions .ts in the config search places in this file: https://github.com/webpack-contrib/postcss-loader/blob/b5c55fb1c5365d8f84a24b246028569a6eb0003f/src/utils.js#L53

Expected Behavior / Situation

Since TailwindCSS as of version ^3.3.0 supports ESM and TypeScript config, the postcss.config.ts should be supported and loaded.

Actual Behavior / Situation

No support for TypeScript config. Breaks: https://github.com/vercel/next.js/issues/47774

Please paste the results of npx webpack info here, and mention other relevant information

I tried to run this command on the reproduction sandbox: https://stackblitz.com/edit/vercel-next-js-p7yaj5

But it fails with the error:

❯ npx webpack info
success Install finished in 3.453s

CLI for webpack must be installed.
  webpack-cli (https://github.com/webpack/webpack-cli)

We will use "npm" to install the CLI via "npm install -D webpack-cli".
Do you want to install 'webpack-cli' (yes/no): no
You need to install 'webpack-cli' to use webpack via CLI.
You can also install the CLI manually.