Skip to content

Commit

Permalink
chore: replace mime with mrmime (vitejs#6312)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Dec 30, 2021
1 parent dc9fce1 commit 8bdb184
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 49 deletions.
29 changes: 0 additions & 29 deletions packages/vite/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2108,35 +2108,6 @@ Repository: micromatch/micromatch
---------------------------------------

## mime
License: MIT
By: Robert Kieffer
Repository: https://github.com/broofa/mime

> The MIT License (MIT)
>
> Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
---------------------------------------

## mime-db
License: MIT
By: Douglas Christopher Wilson, Jonathan Ong, Robert Kieffer
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"launch-editor-middleware": "^2.3.0",
"magic-string": "^0.25.7",
"micromatch": "^4.0.4",
"mime": "^3.0.0",
"mrmime": "^1.0.0",
"okie": "^1.0.1",
"open": "^8.4.0",
"periscopic": "^2.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path'
import { parse as parseUrl } from 'url'
import fs, { promises as fsp } from 'fs'
import mime from 'mime/lite'
import * as mrmime from 'mrmime'
import type { Plugin } from '../plugin'
import type { ResolvedConfig } from '../config'
import { cleanUrl } from '../utils'
Expand Down Expand Up @@ -295,7 +295,7 @@ async function fileToBuiltUrl(
content.length < Number(config.build.assetsInlineLimit))
) {
// base64 inlined as a string
url = `data:${mime.getType(file)};base64,${content.toString('base64')}`
url = `data:${mrmime.lookup(file)};base64,${content.toString('base64')}`
} else {
// emit as asset
// rollup supports `import.meta.ROLLUP_FILE_URL_*`, but it generates code
Expand Down
53 changes: 36 additions & 17 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 8bdb184

Please sign in to comment.