@@ -3,13 +3,14 @@ import fs from 'fs';
3
3
import { resolve } from 'path'
4
4
import { defineConfig } from 'vite'
5
5
import { ViteEjsPlugin } from "vite-plugin-ejs" ;
6
+ import { codecovVitePlugin } from "@codecov/vite-plugin" ;
6
7
import vue from '@vitejs/plugin-vue'
7
8
import process from 'process'
8
9
9
10
/**
10
11
* Before actually building the pages with Vite, we do an intermediate build step using ejs
11
- * Importing this separately and joining them using ejs
12
- * allows us to split some repeating HTML that cannot be added
12
+ * Importing this separately and joining them using ejs
13
+ * allows us to split some repeating HTML that cannot be added
13
14
* by Vue itself (e.g. style/script loading, common meta head tags, Widgetbot)
14
15
* The vite-plugin-ejs handles this automatically
15
16
*/
@@ -49,7 +50,16 @@ export default defineConfig({
49
50
}
50
51
} ,
51
52
base : './' ,
52
- plugins : [ vue ( ) , ViteEjsPlugin ( { header } ) ] ,
53
+ plugins : [
54
+ vue ( ) ,
55
+ ViteEjsPlugin ( { header } ) ,
56
+ // The Codecov vite plugin should be after all other plugins
57
+ codecovVitePlugin ( {
58
+ enableBundleAnalysis : process . env . CODECOV_TOKEN !== undefined ,
59
+ bundleName : "sunshine" ,
60
+ uploadToken : process . env . CODECOV_TOKEN ,
61
+ } ) ,
62
+ ] ,
53
63
root : resolve ( assetsSrcPath ) ,
54
64
build : {
55
65
outDir : resolve ( assetsDstPath ) ,
0 commit comments