Сделано разработчиком @denpiligrim
В tsconfig.json определяем параметр:
{
"compilerOptions": {
"module": "CommonJS"
}
}
В package.json определяем параметр:
{
"type": "commonjs"
}
Запускаем скрипт командой npm run manifest
или ts-node generateManifest.ts
- Перейдите на страницу WebP от Google.
- Скачайте WebP Utilities for Windows, обычно архив называется
libwebp-x.x.x-windows.zip
, гдеx.x.x
— версия. - Распакуйте скачанный архив в удобное место, например, в папку
C:\webp
.
Добавьте путь к cwebp.exe
в переменную окружения PATH, чтобы иметь возможность запускать его из любой папки.
- Откройте Параметры > Система > О системе > Дополнительные параметры системы.
- В разделе Переменные среды выберите переменную Path и нажмите Изменить.
- Нажмите Создать и укажите путь к папке, где находится cwebp.exe. Например,
C:\webp\bin
. - Сохраните изменения и закройте все окна.
Теперь cwebp доступен для выполнения в любой директории.
Откройте Командную строку и выполните команду:
cwebp -version
Get-ChildItem -File | Where-Object { $_.Extension -match '\.(webp|jpg|jpeg|JPG|PNG|png|GIF|gif)$' } | ForEach-Object { cwebp -q 90 $_.FullName -o "$($_.DirectoryName)\$($_.BaseName).webp" }
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list