-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
69 lines (68 loc) · 2.21 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { createHtmlPlugin } from 'vite-plugin-html';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import * as partials from '@porsche-design-system/components-react/partials';
export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
plugins: [
react(),
createHtmlPlugin({
inject: {
data: {
headPartials: [
partials.getMetaTagsAndIconLinks({ appTitle: 'Sample Integration React' }),
partials.getInitialStyles({
skeletonTagNames: [
'p-button',
'p-button-pure',
'p-checkbox-wrapper',
'p-fieldset-wrapper',
'p-link',
'p-link-pure',
'p-radio-button-wrapper',
'p-select-wrapper',
'p-textarea-wrapper',
'p-text-field-wrapper',
],
}),
partials.getFontFaceStyles(),
partials.getFontLinks({ weights: ['regular', 'semi-bold', 'bold'] }),
partials.getComponentChunkLinks({
components: [
'button',
'checkbox-wrapper',
'divider',
'flex',
'grid',
'headline',
'link',
'link-pure',
'modal',
'pagination',
'radio-button-wrapper',
'select-wrapper',
'spinner',
'tabs',
'text',
'textarea-wrapper',
'text-field-wrapper',
],
}),
partials.getIconLinks({ icons: ['arrow-head-right', 'highway', 'search', 'compare', 'configurate'] }),
].join('\n'),
bodyPartials: [
partials.getLoaderScript(),
partials.getBrowserSupportFallbackScript(),
partials.getCookiesFallbackScript(),
].join('\n'),
},
},
}),
vanillaExtractPlugin(),
],
};
});