lahmatiy / postcss-csso

PostCSS plugin to minify CSS using CSSO
MIT License
119 stars 6 forks source link

TypeScript types #30

Open laurentpayot opened 1 year ago

laurentpayot commented 1 year ago

Hi, thanks for this nice plugin :+1:

When importing the plugin in my vite.config.ts file

import cssoPlugin from 'postcss-csso'

I get the following error in VS Code:

Could not find a declaration file for module 'postcss-csso'. '/home/laurent/projects/myproject/node_modules/.pnpm/postcss-csso@6.0.1_postcss@8.4.21/node_modules/postcss-csso/cjs/index.cjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/postcss-csso` if it exists or add a new declaration (.d.ts) file containing `declare module 'postcss-csso';`ts(7016)

Could a type declaration file be added to tame TypeScript?

Cheers, Laurent