Skip to content

Commit

Permalink
fix: Allow vite 6.0.9+ (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Mar 4, 2025
1 parent 665f5a5 commit c9eb3b0
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 53 deletions.
3 changes: 1 addition & 2 deletions packages/wxt/e2e/tests/npm-packages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ test('Only one version of esbuild should be installed (each version is ~20mb of
if (name === 'esbuild') esbuildVersions.add(meta.version);
});

// TODO: Revert to 1 once vite is upgraded to >6.0.8
expect([...esbuildVersions]).toHaveLength(2);
expect([...esbuildVersions]).toHaveLength(1);
});

function iterateDependencies(
Expand Down
5 changes: 5 additions & 0 deletions packages/wxt/src/core/builders/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export async function createViteBuilder(
ignored: [`${wxtConfig.outBaseDir}/**`, `${wxtConfig.wxtDir}/**`],
};

// TODO: Remove once https://github.com/wxt-dev/wxt/pull/1411 is merged
config.legacy ??= {};
// @ts-ignore: Untyped option:
config.legacy.skipWebSocketTokenCheck = true;

const server = getWxtDevServer?.();

config.plugins ??= [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import path from 'node:path';
let increment = 0;

export function bundleAnalysis(config: ResolvedConfig): vite.Plugin {
// @ts-expect-error: Mismatched vite version
return visualizer({
template: 'raw-data',
filename: path.resolve(
Expand Down
98 changes: 49 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ catalog:
unbuild: ^3.5.0
unimport: ^3.13.1
unocss: ^0.64.0 || ^0.65.0 || ^65.0.0 ||^66.0.0
vite: ^5.0.0 || <=6.0.8
vite: ^5.0.0 || ^6.0.0
vite-node: ^2.1.4 || ^3.0.0
vite-plugin-solid: ^2.11.6
vitepress: ^1.6.3
Expand Down

0 comments on commit c9eb3b0

Please # to comment.