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

[postcss] tsup fails if postcss.config.js is es module #874

Closed
jens-ox opened this issue Apr 1, 2023 · 1 comment · Fixed by #880
Closed

[postcss] tsup fails if postcss.config.js is es module #874

jens-ox opened this issue Apr 1, 2023 · 1 comment · Fixed by #880
Labels

Comments

@jens-ox
Copy link

jens-ox commented Apr 1, 2023

Repro link: https://codesandbox.io/p/sandbox/adoring-hill-k94yyv (script build:tsup)

If postcss.config.js is an es module (i.e. export default { ... }), tsup fails:

> tsup

CLI Building entry: src/index.ts
CLI tsup v6.7.0
CLI Using tsup config: /project/home/jens-ox/workspace/tsup.config.js
CLI Target: esnext
ESM Build start
✘ [ERROR] require() of ES Module /project/home/jens-ox/workspace/postcss.config.js from /project/home/jens-ox/workspace/node_modules/.pnpm/lilconfig@2.1.0/node_modules/lilconfig/dist/index.js not supported.
Instead change the require of postcss.config.js in /project/home/jens-ox/workspace/node_modules/.pnpm/lilconfig@2.1.0/node_modules/lilconfig/dist/index.js to a dynamic import() which is available in all CommonJS modules. [plugin postcss]

Not fully sure why this is the case - lilconfig@2.1.0 should support es modules (since 2.0.5). When compiled with postcss-cli or tailwindcss (both also using postcss-load-config@3.1.4), no errors occur.

Maybe this is fixable by just updating postcss-load-config?

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

1 participant