Refactor query message toast

This commit is contained in:
GW_MC
2025-12-20 14:27:08 +08:00
parent a88e4d7274
commit 0260a03e1b
8 changed files with 287 additions and 160 deletions

View File

@@ -5,14 +5,34 @@ import tsconfigPaths from 'vite-tsconfig-paths';
// @ts-expect-error vite-plugin-eslint has no types
import eslint from 'vite-plugin-eslint';
export default defineConfig({
plugins: [
tailwindcss(),
reactRouter(),
tsconfigPaths(),
eslint({
failOnError: false,
}),
],
appType: 'spa',
export default defineConfig(({ command }) => {
const isBuild = command === 'build';
return {
plugins: [
tailwindcss(),
reactRouter(),
tsconfigPaths(),
eslint({
failOnError: false,
}),
],
resolve: {
alias: isBuild
? [
{
// replace unstyled import with styled for SPA build
find: 'react-toastify/unstyled',
replacement: 'react-toastify',
},
{
// point to the empty CSS file to stub out the import during build, SPA build does not require extra CSS imports
find: 'react-toastify/ReactToastify.css',
replacement: '~/empty-toastify.css',
},
]
: [],
},
appType: 'spa',
};
});