2023-06-05 00:58:21 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-04-17 20:01:17 +02:00
|
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
|
|
|
|
2023-08-11 17:30:22 +02:00
|
|
|
import path from 'path';
|
2023-06-05 00:58:21 +02:00
|
|
|
import { defineConfig } from 'vite';
|
2023-08-11 17:30:22 +02:00
|
|
|
import react from '@vitejs/plugin-react-swc';
|
2023-06-05 00:58:21 +02:00
|
|
|
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
2024-03-26 23:39:25 +01:00
|
|
|
import legacy from '@vitejs/plugin-legacy';
|
2023-06-05 00:58:21 +02:00
|
|
|
|
2023-11-25 18:13:51 +01:00
|
|
|
// TODO - switch to ESM - with Vite v5.x the CJS build is deprecated (https://vitejs.dev/guide/migration)
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
2023-06-05 00:58:21 +02:00
|
|
|
export default defineConfig(() => ({
|
|
|
|
|
build: {
|
|
|
|
|
outDir: 'build',
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
port: 3000,
|
|
|
|
|
},
|
2023-06-17 20:53:00 +02:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-04-14 15:11:13 +02:00
|
|
|
optimizeDeps: {
|
|
|
|
|
include: ['@mui/material/Tooltip'],
|
|
|
|
|
},
|
2024-03-26 23:39:25 +01:00
|
|
|
plugins: [
|
|
|
|
|
react(),
|
|
|
|
|
viteTsconfigPaths(),
|
|
|
|
|
legacy({
|
|
|
|
|
modernPolyfills: [
|
|
|
|
|
'es/array/to-spliced',
|
|
|
|
|
'es/array/to-sorted',
|
|
|
|
|
'es/array/find-last',
|
|
|
|
|
'es/array/find-last-index',
|
|
|
|
|
],
|
|
|
|
|
}),
|
|
|
|
|
],
|
2023-06-05 00:58:21 +02:00
|
|
|
}));
|