From df2cb91c294047d5d034ef4d1c255f5978c61cbc Mon Sep 17 00:00:00 2001 From: Curry Yang <1019yanglu@gmail.com> Date: Mon, 13 May 2024 11:08:15 +0800 Subject: [PATCH] fix: worker build --- packages/insomnia/vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/insomnia/vite.config.ts b/packages/insomnia/vite.config.ts index 90ebe3243b7..e2ab40b7059 100644 --- a/packages/insomnia/vite.config.ts +++ b/packages/insomnia/vite.config.ts @@ -40,6 +40,9 @@ export default defineConfig(({ mode }) => { }, optimizeDeps: { exclude: ['@getinsomnia/node-libcurl'], + // these packages are only used in web worker, Vite won't be able to discover the import on the initial scan,so we need to include them here to let vite pre-bundle them + // https://vitejs.dev/guide/dep-pre-bundling.html#customizing-the-behavior + include: ['@stoplight/spectral-core', '@stoplight/spectral-ruleset-bundler/with-loader', '@stoplight/spectral-rulesets'], }, plugins: [ // Allows us to import modules that will be resolved by Node's require() function.