Skip to content

Commit

Permalink
Merge pull request #2239 from embroider-build/test-vite-6
Browse files Browse the repository at this point in the history
Adding test coverage for vite 6
  • Loading branch information
ef4 authored Feb 5, 2025
2 parents 0f6c294 + df96dfb commit 06606b1
Show file tree
Hide file tree
Showing 11 changed files with 2,529 additions and 2,097 deletions.
4 changes: 2 additions & 2 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"peerDependencies": {
"@embroider/core": "workspace:^",
"vite": "^5.2.0"
"vite": ">= 5.2.0"
},
"scripts": {
"test": "jest"
Expand Down Expand Up @@ -41,7 +41,7 @@
"@types/jsdom": "^16.2.11",
"@types/send": "^0.17.4",
"rollup": "^4.18.0",
"vite": "^5.3.3"
"vite": "^6.0.0"
},
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function compatPrebuild(): Plugin {
name: 'embroider-builder',
enforce: 'pre',
config(config, { mode, command }) {
viteCommand = command;
viteCommand = process.env.EMBROIDER_VITE_COMMAND ?? command;
viteMode = mode;
resolvableExtensions = config.resolve?.extensions;
},
Expand Down
5 changes: 3 additions & 2 deletions packages/vite/src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ export function resolver(): Plugin {
context: PluginContext,
source: string,
importer: string | undefined,
options: { custom?: Record<string, unknown> }
options: { custom?: Record<string, unknown>; scan?: boolean }
) {
if (options.custom?.depScan) {
// vite 5 exposes `custom.depscan`, vite 6 exposes `options.scan`
if (options.custom?.depScan || options.scan) {
return await observeDepScan(context, source, importer, options);
}

Expand Down
Loading

0 comments on commit 06606b1

Please sign in to comment.