vite-plugin-sass-dts icon indicating copy to clipboard operation
vite-plugin-sass-dts copied to clipboard

prettierFilePath not working

Open EtienneT opened this issue 1 year ago • 3 comments

Could you provide an example for using prettierFilePath? From everything I tried, it is not working.

Sometimes vite-plugin-sass-dts runs on a file and generate slightly different tabs at the beginning of lines, which trigger a change in git. Nothing changed really in the sass file, but the generated file changes. I was hoping prettierFilePath might resolve this, but I can't get it to work, and there's no example.

Thanks!

EtienneT avatar Apr 29 '24 15:04 EtienneT

@EtienneT

Can I work around this by setting the options as follows? https://github.com/activeguild/vite-plugin-sass-dts/blob/66974a6855d2cf68e073ae2f2be7be13d884f8e1/example/react-sass/vite.config.ts#L41

activeguild avatar Apr 30 '24 08:04 activeguild

@activeguild, I tried using the exact same file as the example. The .prettierrc.cjs file is at the root directory with my vite.config.js file. I declare the plugin like so:

sassDts({ esmExport: true, prettierFilePath: resolve(__dirname, '.prettierrc.cjs') })

I try putting tabWith of 10 in the .prettierrc.cjs file to test if prettier settings are taken into account, but they are not. When I modify a .scss file, the esmExport option is taken into account, but not prettier.

Also if I input an invalid path in prettierFilePath, I don't get any error.

EtienneT avatar Apr 30 '24 13:04 EtienneT

@EtienneT

Is it possible to have you provide a minimum sample of the bugs that will occur?

activeguild avatar May 01 '24 00:05 activeguild

I made a smaller vite project from the vite templates to try to replicate this problem and realized it worked on the smaller project. Now found why it was not working on my larger project.

Thanks,

EtienneT avatar May 07 '24 15:05 EtienneT