Skip to content

Commit

Permalink
fix: vite6
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Nov 26, 2024
1 parent 30cc9a3 commit c3a1d5f
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
run: pnpm playwright install

- name: test 5.x
run: pnpm exec vitest e2e/vite5/*.spec.ts --coverage.enabled=false
run: pnpm exec vitest e2e/vite[5-6]/*.spec.ts --coverage.enabled=false
3 changes: 2 additions & 1 deletion e2e/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import type { Vite2Instance } from './vite2/interface'
import type { Vite3Instance } from './vite3/interface'
import type { Vite4Instance } from './vite4/interface'
import type { Vite5Instance } from './vite5/interface'
import type { Vite6Instance } from './vite6/interface'

type ViteInstance = Vite2Instance | Vite3Instance | Vite4Instance | Vite5Instance
type ViteInstance = Vite2Instance | Vite3Instance | Vite4Instance | Vite5Instance | Vite6Instance

type Server = http.Server & {
ip: string
Expand Down
14 changes: 14 additions & 0 deletions e2e/vite6/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { describe } from 'vitest'
import { runTest } from '../e2e'
import { name } from './package.json'

describe('vite6', async () => {
const vite = await import('vite')

await runTest(name, {
vite,
compressOption: {
deleteOriginalAssets: true
}
})
})
1 change: 1 addition & 0 deletions e2e/vite6/interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Vite6Instance = typeof import('vite')
6 changes: 6 additions & 0 deletions e2e/vite6/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "vite-plugin-compression2-e2e-vite6",
"dependencies": {
"vite": "^6"
}
}
2 changes: 1 addition & 1 deletion example/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
import { compression } from 'vite-plugin-compression2'
import { compression } from '../src'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"tar-mini": "^0.2.0"
},
"optionalDependencies": {
"vite": "^5.3.4"
"vite": "^6"
},
"resolutions": {
"is-core-module": "npm:@nolyfill/is-core-module@^1",
Expand Down
Loading

0 comments on commit c3a1d5f

Please sign in to comment.