FatehAK / vite-plugin-image-optimizer

Optimize your image assets using Sharp.js and SVGO.
MIT License
311 stars 15 forks source link

Type definitions for project #12

Closed FranciscoKloganB closed 1 year ago

FranciscoKloganB commented 1 year ago

Describe the Bug

When I import ViteImageOptimizer } in nuxt.config.ts on a TypeScript based project Then a warning about missing type declarations occurs

Steps to reproduce

Create new nuxt project Install plugins and dependencies (sharp, svgo)

Add to nuxt.config.ts

// `Could not find a declaration file for module 'vite-plugin-image-optimizer'`
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'

Results in the error above, no types exist for lib.

System Info

Windows 11 (but same result in Ubuntu 22.04 and MacOS latest)

 System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 37.36 GB / 63.93 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.963.0), Chromium (110.0.1587.49)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.0.0
    vite: ^4.1.4 => 4.1.4
    vite-plugin-image-optimizer: ^1.0.8 => 1.0.8
    vite-tsconfig-paths: ^4.0.5 => 4.0.5
    vitest: ^0.28.5 => 0.28.5

Used Package Manager

pnpm

Validations

FatehAK commented 1 year ago

Thanks for raising this issue. Type definitions have been added to the project now. Please update the package to v1.0.10.

FatehAK commented 1 year ago

I've published v1.1.0 with full TS typings please check with that version.