Skip to content

Commit

Permalink
fix(web-extension): Fix types in vite config (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg authored Sep 22, 2023
1 parent 1172d6f commit b1775d0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/web-extension/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
defineConfig,
LibraryFormats,
LibraryOptions,
PluginOption,
} from 'vite';
import { defineConfig, LibraryFormats, PluginOption } from 'vite';
import webExtension, { readJsonFile } from 'vite-plugin-web-extension';
import zip from 'vite-plugin-zip-pack';
import * as path from 'path';
Expand All @@ -17,9 +12,8 @@ function useSpecialFormat(
return {
name: 'use-special-format',
config(config) {
const shouldUse = entriesToUse.includes(
(config.build?.lib as LibraryOptions)?.entry,
);
const shouldUse =
config.build?.lib && entriesToUse.includes(config.build.lib.entry);
if (shouldUse) {
config.build = config.build ?? {};
// @ts-expect-error: lib needs to be an object, forcing it.
Expand Down

0 comments on commit b1775d0

Please sign in to comment.