1
1
import react from "@vitejs/plugin-react"
2
2
import { existsSync , readdirSync , statSync } from "fs"
3
3
import path , { resolve } from "path"
4
+ import { InputOption } from "rollup"
4
5
import modulepreload from "rollup-plugin-modulepreload"
5
6
import { injectManifest } from "rollup-plugin-workbox"
6
7
import Unfonts from "unplugin-fonts/vite"
@@ -121,7 +122,7 @@ function indexSwitchPlugin(target: string): Plugin {
121
122
try {
122
123
statSync ( candidate )
123
124
return candidate
124
- } catch ( e ) {
125
+ } catch ( _ ) {
125
126
return null
126
127
}
127
128
} ,
@@ -337,7 +338,7 @@ const generateHydraUrl = (env: string) => {
337
338
}
338
339
339
340
// Main Ref: https://vitejs.dev/config/
340
- const setConfig : ( env : ConfigEnv ) => UserConfigExport = ( { mode, command } ) => {
341
+ const setConfig : ( env : ConfigEnv ) => UserConfigExport = ( { mode } ) => {
341
342
const externalEnv = {
342
343
...loadEnv ( mode , process . cwd ( ) ) ,
343
344
...process . env ,
@@ -352,7 +353,6 @@ const setConfig: (env: ConfigEnv) => UserConfigExport = ({ mode, command }) => {
352
353
353
354
const buildTarget : BuildTarget = ( process . env . TARGET as BuildTarget ) || "web"
354
355
const isDev = mode === "development"
355
- const isServe = command === "serve"
356
356
// quick look-up (not using isServe atm, but expecting to optimise plugins later)
357
357
// - vite .. isDev: true isServe: true (building with esbuild AND serving)
358
358
// - vite preview .. isDev: false isServe: true (just running static, so don't need any plugins etc.)
@@ -386,7 +386,7 @@ const setConfig: (env: ConfigEnv) => UserConfigExport = ({ mode, command }) => {
386
386
387
387
plugins . push ( fontFacePreload )
388
388
389
- const input = {
389
+ const input : InputOption = {
390
390
main : resolve ( __dirname , "index.html" ) ,
391
391
}
392
392
if ( buildTarget === "openfin" ) {
0 commit comments