parcel-plugin-typescript icon indicating copy to clipboard operation
parcel-plugin-typescript copied to clipboard

Integrate typed-css-modules

Open mohsen1 opened this issue 6 years ago • 7 comments

Would you accept a pull request to add support for typed-css-modules or you think that should be a different plugin on its own?

Related to https://github.com/Quramy/typed-css-modules/issues/51

mohsen1 avatar Jul 17 '18 17:07 mohsen1

👍 it would be more than welcome, let me know if you need any help

fathyb avatar Jul 19 '18 08:07 fathyb

I've implemented this over at https://github.com/place1/parcel-plugin-typed-css-modules

Place1 avatar Aug 09 '18 10:08 Place1

That's great! I believe Parcel has of not actually writing to disk for this. @fathyb Can you confirm if that's true?

mohsen1 avatar Aug 09 '18 16:08 mohsen1

@mohsen1 I can’t understand what you’re asking 😬

Place1 avatar Aug 10 '18 06:08 Place1

I mean those .d.ts files. Can we avoid writing those on disk

mohsen1 avatar Aug 10 '18 20:08 mohsen1

right. i chose to write them to the file system because that's what webpack typed css modules loader does.

importantly, it means the TS compiler and IDEs can find the declaration files. This is very useful because it means the language server can offer automatic import hints when typing css class names in ts files.

with that said, i haven't really thought about an alternative, do you have something in mind?

Place1 avatar Aug 11 '18 03:08 Place1

I think I remember now. Parcel is not using a memory fs yet. Once Parcel supports memory fs we can "write" to that fs without actually messing up the actual fs. TS language server does support custom fs. that's how it works in browser.

I guess if you avoid writing to actual disk then you need to run a custom language server for your IDE as well. Maybe it doesn't worth it.

mohsen1 avatar Aug 11 '18 14:08 mohsen1