-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.js
77 lines (75 loc) · 2.06 KB
/
vite.config.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
import { VitePWA } from 'vite-plugin-pwa';
import federation from '@originjs/vite-plugin-federation';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
const __dirname = dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
exclude: ['tests/', 'node_modules'],
coverage: {
reporter: ['text', 'html'],
exclude: ['node_modules/', 'src/setupTests.js'],
},
},
resolve: {
alias: {
i18n: resolve(__dirname, 'src/i18n/index.js'),
utils: resolve(__dirname, 'src/utils'),
},
},
build: {
outDir: 'build',
target: 'esnext',
},
plugins: [
tsconfigPaths(),
react(),
federation({
name: 'Pearl',
remotes: {
dramaQueen: {
external:
"fetch(`${window.location.origin}/configuration.json`).then(response => response.json().then(configurationResponse => {const { QUEEN_URL } = configurationResponse; return QUEEN_URL + '/assets/remoteEntry.js';}))",
externalType: 'promise',
},
},
}),
VitePWA({
injectRegister: 'null',
strategies: 'injectManifest',
srcDir: 'src',
filename: 'service-worker.js',
manifest: {
short_name: 'Pearl',
name: 'Organisation de la collecte des questionnaire en face à face',
icons: [
{
src: 'favicon.ico',
sizes: '32x32',
type: 'image/x-icon',
},
{
src: 'static/images/insee.png',
sizes: '326x378',
type: 'image/png',
},
{
src: 'static/images/logo-insee-header.png',
sizes: '270x274',
type: 'image/png',
},
],
start_url: '.',
display: 'standalone',
theme_color: '#000000',
background_color: '#ffffff',
},
}),
],
});