Skip to content

Commit

Permalink
fix: don't crash when there are no scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Nov 8, 2021
1 parent 233ba80 commit 1f564a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default function browserExtension<T>(
let webExtRunner: any;
let isWatching: boolean;
let finalConfig: UserConfig;
let scriptInputs: BuildScriptCache[];
let scriptInputs: BuildScriptCache[] | undefined;

return {
name: "vite-plugin-web-extension",
Expand Down Expand Up @@ -320,7 +320,7 @@ export default function browserExtension<T>(

async closeBundle() {
log("Content scripts to build in lib mode:", scriptInputs);
for (const input of scriptInputs) {
for (const input of scriptInputs ?? []) {
await buildScript({
...input,
vite: finalConfig,
Expand Down

0 comments on commit 1f564a4

Please sign in to comment.