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

Generate app.d.css.ts instead of app.css.d.ts #49

Open
bhollis opened this issue Sep 14, 2023 · 0 comments
Open

Generate app.d.css.ts instead of app.css.d.ts #49

bhollis opened this issue Sep 14, 2023 · 0 comments

Comments

@bhollis
Copy link
Contributor

bhollis commented Sep 14, 2023

TypeScript now supports an allowArbitraryExtensions setting, which allows it to properly find definitions for app.css in app.d.css.ts. From their docs:

Note that historically, a similar effect has often been achievable by adding a declaration file named app.css.d.ts instead of app.d.css.ts - however, this just worked through Node’s require resolution rules for CommonJS. Strictly speaking, the former is interpreted as a declaration file for a JavaScript file named app.css.js. Because relative files imports need to include extensions in Node’s ESM support, TypeScript would error on our example in an ESM file under --moduleResolution node16 or nodenext.

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

1 participant