activeguild / vite-plugin-sass-dts

This is a plugin that automatically creates a type file when using the CSS module type-safely.
MIT License
120 stars 19 forks source link

Exports based on filename #62

Closed tomahl closed 1 year ago

tomahl commented 1 year ago

Hi again.

Currently, all exports use the same name const classNames and type ClassNames which Imo makes imports via autocompletion less readable. It would have been great if there was a choice where these names were based on the fileName instead. So my file colors.scss would export something like const colors: {} and type ColorNames or ColorKeys etc.

Keep up the good work.

activeguild commented 1 year ago

I think.

It might be a good idea to provide an option like 'replacement' so that the variable to be output can be replaced.

activeguild commented 1 year ago

@tomahl

Should be fixed in with!

"vite-plugin-sass-dts": "^1.2.6"

Thanks for the issue!!