Skip to content

Commit 050ae04

Browse files
committed
chore: export vite config as funnction
- Only apply eslint in development mode - Delete outdated test config
1 parent 0836050 commit 050ae04

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

vite.config.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const PWAConfig = {
3636
};
3737

3838
// https://vitejs.dev/config/
39-
export default defineConfig({
39+
export default defineConfig(({ mode }) => ({
4040
build: {
4141
outDir: './build',
4242
target: 'esnext',
@@ -57,7 +57,7 @@ export default defineConfig({
5757
},
5858
},
5959
plugins: [
60-
eslint({ cache: false, formatter: 'stylish' }),
60+
mode === 'development' && eslint(),
6161
react(),
6262
svgr({ exportAsDefault: true }),
6363
VitePWA(PWAConfig),
@@ -67,10 +67,5 @@ export default defineConfig({
6767
globals: true,
6868
environment: 'jsdom',
6969
setupFiles: './tests/setup.js',
70-
server: {
71-
// Prevents Vitest from crashing when it
72-
// encounters a module that exports CSS.
73-
deps: { inline: true },
74-
},
7570
},
76-
});
71+
}));

0 commit comments

Comments
 (0)