-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
41 lines (39 loc) · 1.36 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import StylelintPlugin from 'vite-plugin-stylelint';
import eslintPlugin from 'vite-plugin-eslint';
import ViteRequireContext from '@originjs/vite-plugin-require-context';
import { VitePWA } from 'vite-plugin-pwa';
import { resolve } from 'path';
const manifest = require('./src/controller/manifest.ts');
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
ViteRequireContext(),
VitePWA({
base : '/',
srcDir : 'src',
filename : 'sw.ts',
includeAssets: ['/favicon.png'],
strategies : 'injectManifest',
manifest,
}),
eslintPlugin({
fix: true,
}),
StylelintPlugin({
include: ['src/**/*.css', 'src/**/*.scss'],
fix : true,
}),
],
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, 'src') },
{ find: '@assets', replacement: resolve(__dirname, 'src/assets') },
{ find: '@controller', replacement: resolve(__dirname, 'src/controller') },
{ find: '@modules', replacement: resolve(__dirname, 'src/modules') },
{ find: '@components', replacement: resolve(__dirname, 'src/components') },
],
},
});