autobrr/web/vite.config.ts
dependabot[bot] 66696dcb18
build(deps): bump the npm group across 1 directory with 27 updates (#1847)
* build(deps): bump the npm group across 1 directory with 27 updates

Bumps the npm group with 27 updates in the /web directory:

| Package | From | To |
| --- | --- | --- |
| [@headlessui/react](https://github.com/tailwindlabs/headlessui/tree/HEAD/packages/@headlessui-react) | `2.1.8` | `2.2.0` |
| [@heroicons/react](https://github.com/tailwindlabs/heroicons) | `2.1.5` | `2.2.0` |
| [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) | `5.56.2` | `5.61.4` |
| [@tanstack/react-router](https://github.com/TanStack/router/tree/HEAD/packages/react-router) | `1.58.15` | `1.82.12` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.7.4` | `22.10.0` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `18.3.10` | `18.3.12` |
| [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) | `18.3.0` | `18.3.1` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.8.0` | `8.16.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.8.0` | `8.16.0` |
| [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) | `3.7.1` | `3.7.2` |
| [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) | `3.0.2` | `3.0.3` |
| [postcss](https://github.com/postcss/postcss) | `8.4.47` | `8.4.49` |
| [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.53.0` | `7.53.2` |
| [react-select](https://github.com/JedWatson/react-select) | `5.8.1` | `5.8.3` |
| [react-textarea-autosize](https://github.com/Andarist/react-textarea-autosize) | `8.5.3` | `8.5.5` |
| [tailwindcss](https://github.com/tailwindlabs/tailwindcss) | `3.4.13` | `3.4.15` |
| [workbox-window](https://github.com/googlechrome/workbox) | `7.1.0` | `7.3.0` |
| [@rollup/wasm-node](https://github.com/rollup/rollup) | `4.23.0` | `4.27.4` |
| [@tanstack/router-devtools](https://github.com/TanStack/router/tree/HEAD/packages/router-devtools) | `1.58.15` | `1.82.12` |
| [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) | `2.30.0` | `2.31.0` |
| [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | `7.37.0` | `7.37.2` |
| [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) | `4.6.2` | `5.0.0` |
| [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) | `0.4.12` | `0.4.14` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.6.2` | `5.7.2` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `5.4.8` | `6.0.0` |
| [vite-plugin-pwa](https://github.com/vite-pwa/vite-plugin-pwa) | `0.20.5` | `0.21.0` |
| [vite-plugin-svgr](https://github.com/pd4d10/vite-plugin-svgr) | `4.2.0` | `4.3.0` |



Updates `@headlessui/react` from 2.1.8 to 2.2.0
- [Release notes](https://github.com/tailwindlabs/headlessui/releases)
- [Changelog](https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/headlessui/commits/@headlessui/react@v2.2.0/packages/@headlessui-react)

Updates `@heroicons/react` from 2.1.5 to 2.2.0
- [Release notes](https://github.com/tailwindlabs/heroicons/releases)
- [Changelog](https://github.com/tailwindlabs/heroicons/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/heroicons/compare/v2.1.5...v2.2.0)

Updates `@tanstack/react-query` from 5.56.2 to 5.61.4
- [Release notes](https://github.com/TanStack/query/releases)
- [Commits](https://github.com/TanStack/query/commits/v5.61.4/packages/react-query)

Updates `@tanstack/react-router` from 1.58.15 to 1.82.12
- [Release notes](https://github.com/TanStack/router/releases)
- [Commits](https://github.com/TanStack/router/commits/v1.82.12/packages/react-router)

Updates `@types/node` from 22.7.4 to 22.10.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/react` from 18.3.10 to 18.3.12
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@types/react-dom` from 18.3.0 to 18.3.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Updates `@typescript-eslint/eslint-plugin` from 8.8.0 to 8.16.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.16.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.8.0 to 8.16.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.16.0/packages/parser)

Updates `@vitejs/plugin-react-swc` from 3.7.1 to 3.7.2
- [Release notes](https://github.com/vitejs/vite-plugin-react-swc/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react-swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react-swc/compare/v3.7.1...v3.7.2)

Updates `http-proxy-middleware` from 3.0.2 to 3.0.3
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v3.0.2...v3.0.3)

Updates `postcss` from 8.4.47 to 8.4.49
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.47...8.4.49)

Updates `react-hook-form` from 7.53.0 to 7.53.2
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.53.0...v7.53.2)

Updates `react-select` from 5.8.1 to 5.8.3
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.8.1...react-select@5.8.3)

Updates `react-textarea-autosize` from 8.5.3 to 8.5.5
- [Release notes](https://github.com/Andarist/react-textarea-autosize/releases)
- [Changelog](https://github.com/Andarist/react-textarea-autosize/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Andarist/react-textarea-autosize/compare/v8.5.3...v8.5.5)

Updates `tailwindcss` from 3.4.13 to 3.4.15
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.15/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.13...v3.4.15)

Updates `workbox-window` from 7.1.0 to 7.3.0
- [Release notes](https://github.com/googlechrome/workbox/releases)
- [Commits](https://github.com/googlechrome/workbox/compare/v7.1.0...v7.3.0)

Updates `@rollup/wasm-node` from 4.23.0 to 4.27.4
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.23.0...v4.27.4)

Updates `@tanstack/router-devtools` from 1.58.15 to 1.82.12
- [Release notes](https://github.com/TanStack/router/releases)
- [Commits](https://github.com/TanStack/router/commits/v1.82.12/packages/router-devtools)

Updates `eslint-plugin-import` from 2.30.0 to 2.31.0
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.30.0...v2.31.0)

Updates `eslint-plugin-react` from 7.37.0 to 7.37.2
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.37.0...v7.37.2)

Updates `eslint-plugin-react-hooks` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/eslint-plugin-react-hooks@5.0.0/packages/eslint-plugin-react-hooks)

Updates `eslint-plugin-react-refresh` from 0.4.12 to 0.4.14
- [Release notes](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/releases)
- [Changelog](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.12...v0.4.14)

Updates `typescript` from 5.6.2 to 5.7.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.7.2)

Updates `vite` from 5.4.8 to 6.0.0
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.0.0/packages/vite)

Updates `vite-plugin-pwa` from 0.20.5 to 0.21.0
- [Release notes](https://github.com/vite-pwa/vite-plugin-pwa/releases)
- [Commits](https://github.com/vite-pwa/vite-plugin-pwa/compare/v0.20.5...v0.21.0)

Updates `vite-plugin-svgr` from 4.2.0 to 4.3.0
- [Release notes](https://github.com/pd4d10/vite-plugin-svgr/releases)
- [Commits](https://github.com/pd4d10/vite-plugin-svgr/compare/v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: "@headlessui/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@heroicons/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@tanstack/react-query"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@tanstack/react-router"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@types/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@types/react-dom"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@vitejs/plugin-react-swc"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: http-proxy-middleware
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: postcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: react-select
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: react-textarea-autosize
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: tailwindcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: workbox-window
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@rollup/wasm-node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@tanstack/router-devtools"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: eslint-plugin-react-hooks
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: npm
- dependency-name: eslint-plugin-react-refresh
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: npm
- dependency-name: vite-plugin-pwa
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: vite-plugin-svgr
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(build/web): do not create manifest.json
chore(build/web): remove directive to ignore sourcemap warnings

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-12-06 13:02:27 +01:00

117 lines
3.7 KiB
TypeScript

import { fileURLToPath, URL } from "node:url";
import { defineConfig, loadEnv, ConfigEnv } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import react from "@vitejs/plugin-react-swc";
import svgr from "vite-plugin-svgr";
interface PreRenderedAsset {
name: string | undefined;
source: string | Uint8Array;
type: 'asset';
}
// https://vitejs.dev/config/
export default ({ mode }: ConfigEnv) => {
// early load .env file
// import.meta.env.VITE_NAME available here with: process.env.VITE_NAME
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
base: "",
plugins: [react(), svgr(), VitePWA({
injectRegister: null,
selfDestroying: true,
scope: "{{.BaseUrl}}",
// strategies: "injectManifest",
useCredentials: true,
includeAssets: [
// looks inside "public" folder
// manifest's icons are automatic added
"favicon.ico"
],
manifest: {
name: "autobrr",
short_name: "autobrr",
description: "Automation for downloads.",
theme_color: "#141415",
background_color: "#141415",
icons: [
{
src: "logo192.png",
sizes: "192x192",
type: "image/png"
},
{
src: "apple-touch-icon-iphone-60x60.png",
sizes: "60x60",
type: "image/png"
},
{
src: "apple-touch-icon-ipad-76x76.png",
sizes: "76x76",
type: "image/png"
},
{
src: "apple-touch-icon-iphone-retina-120x120.png",
sizes: "120x120",
type: "image/png"
},
{
src: "apple-touch-icon-ipad-retina-152x152.png",
sizes: "152x152",
type: "image/png"
}
],
start_url: "{{.BaseUrl}}",
scope: "{{.BaseUrl}}",
display: "standalone"
},
workbox: {
// looks inside "dist" folder
globPatterns: ["**/*.{js,css,html,svg,woff2}"],
sourcemap: true,
navigateFallbackDenylist: [/^\/api/]
}
})],
resolve: {
alias: [
{ find: "@", replacement: fileURLToPath(new URL("./src/", import.meta.url)) },
{ find: "@app", replacement: fileURLToPath(new URL("./src/", import.meta.url)) },
{ find: "@components", replacement: fileURLToPath(new URL("./src/components", import.meta.url)) },
{ find: "@forms", replacement: fileURLToPath(new URL("./src/forms", import.meta.url)) },
{ find: "@hooks", replacement: fileURLToPath(new URL("./src/hooks", import.meta.url)) },
{ find: "@api", replacement: fileURLToPath(new URL("./src/api", import.meta.url)) },
{ find: "@screens", replacement: fileURLToPath(new URL("./src/screens", import.meta.url)) },
{ find: "@utils", replacement: fileURLToPath(new URL("./src/utils", import.meta.url)) },
{ find: "@types", replacement: fileURLToPath(new URL("./src/types", import.meta.url)) },
{ find: "@domain", replacement: fileURLToPath(new URL("./src/domain", import.meta.url)) }
]
},
server: {
port: 3000,
hmr: {
overlay: true
},
proxy: {
"/api": {
target: "http://127.0.0.1:7474/",
changeOrigin: true,
secure: false
}
}
},
build: {
sourcemap: true,
rollupOptions: {
output: {
assetFileNames: (chunkInfo: PreRenderedAsset) => {
if (chunkInfo.name === "Inter-Variable.woff2") {
return "assets/[name][extname]";
}
return "assets/[name]-[hash][extname]";
}
},
}
}
});
};