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

CLI does not support TypeScript #72

Open
iBobik opened this issue Sep 21, 2022 · 7 comments
Open

CLI does not support TypeScript #72

iBobik opened this issue Sep 21, 2022 · 7 comments

Comments

@iBobik
Copy link

iBobik commented Sep 21, 2022

$ npx tailwind-config-viewer export public
node:internal/modules/cjs/loader:959
  throw err;
  ^
Error: Cannot find module '/tailwind.config.js'
npx tailwind-config-viewer export -c tailwind.config.ts
/Users/Bobik/Sites/vitae-frontend/tailwind.config.ts:1
import { Config } from 'tailwindcss'
^^^^^^

SyntaxError: Cannot use import statement outside a module

When using Taiwind Nuxt module which has viewer embeded TS config works with dev server.

@iBobik iBobik changed the title CLI does not see tailwind.config.ts CLI does not support TypeScript Sep 21, 2022
@Shmookoff
Copy link

has anyone made progress on this..?

@nbrdx
Copy link

nbrdx commented Dec 18, 2023

I'm also interested in any progress on this feature 👍

@rogden
Copy link
Owner

rogden commented Dec 21, 2023

Though the importing of Config is only necessary for TS, this seems less like a TS issue and more an ESM issue correct?

@urbgimtam
Copy link

Interested in this too. 👀

@kedarguy
Copy link

kedarguy commented Jan 3, 2024

Here is a workaround that worked for me, add the following scripts to package.json

"compile-tw-config": "tsc tailwind.config.ts --outDir dist-tw-config",
"tailwind-config-viewer": "npm run compile-tw-config && tailwind-config-viewer -c dist-tw-config/tailwind.config.js -o -p 3003",
"tailwind-config-export": "npm run compile-tw-config && tailwind-config-viewer -c dist-tw-config/tailwind.config.js export ../design-system"

@luixo
Copy link

luixo commented Apr 21, 2024

A very important feature, a pity typescript doesn't work at the moment.

@ineshbose
Copy link
Contributor

When using Tailwind Nuxt module which has viewer embeded TS config works with dev server.

This issue shouldn't persist in the latest versions of the module I hope?

I think ESM support within the module (aside from configs) is #49.

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

No branches or pull requests

8 participants