Skip to content

Commit

Permalink
refactor: use @polka/compression
Browse files Browse the repository at this point in the history
  • Loading branch information
chaejunlee committed Mar 12, 2024
1 parent 37af8a7 commit ce95b8d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 119 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ module.exports = defineConfig({
'n/no-extraneous-import': [
'error',
{
allowModules: ['vite', 'less', 'sass', 'vitest', 'unbuild'],
allowModules: [
'vite',
'less',
'sass',
'vitest',
'unbuild',
'@polka/compression',
],
},
],
'n/no-extraneous-require': [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"devDependencies": {
"@babel/types": "^7.23.9",
"@eslint-types/typescript-eslint": "^6.21.0",
"@polka/compression": "^1.0.0-next.25",
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.9.6",
Expand Down
6 changes: 6 additions & 0 deletions packages/vite/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ Repository: https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk
---------------------------------------

## @polka/compression
License: MIT
Repository: lukeed/polka

---------------------------------------

## @polka/url
License: MIT
By: Luke Edwards
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
import sirv from 'sirv'
import compression from '@polka/compression'
import connect from 'connect'
import type { Connect } from 'dep-types/connect'
import corsMiddleware from 'cors'
Expand All @@ -18,7 +19,6 @@ import {
setClientErrorHandler,
} from './http'
import { openBrowser } from './server/openBrowser'
import compression from './server/middlewares/compression'
import { baseMiddleware } from './server/middlewares/base'
import { htmlFallbackMiddleware } from './server/middlewares/htmlFallback'
import { indexHtmlMiddleware } from './server/middlewares/indexHtml'
Expand Down
117 changes: 0 additions & 117 deletions packages/vite/src/node/server/middlewares/compression.ts

This file was deleted.

8 changes: 8 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit ce95b8d

Please sign in to comment.