diff --git a/package-lock.json b/package-lock.json index 3baa1fb6..ae11f165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "cjs-module-lexer": "^1.3.1", "es-module-lexer": "^1.5.4", "esbuild": "^0.19.2", - "mime": "^3.0.0", "postcss": "^8.4.28", "puppeteer": "^21.1.0", "rollup": "^3.28.1", @@ -37,7 +36,6 @@ "@testing-library/dom": "9.3.0", "@testing-library/jest-dom": "6.0.1", "@types/jest": "29.5.12", - "@types/mime": "3.0.1", "@types/node": "16.18.34", "@types/polka": "0.5.4", "@typescript-eslint/eslint-plugin": "6.4.1", @@ -56,6 +54,7 @@ "kolorist": "1.8.0", "liquidjs": "10.7.1", "magic-string": "0.30.3", + "mime": "4.0.4", "polka": "0.5.2", "preact": "10.15.1", "prettier": "3.0.2", @@ -12936,14 +12935,18 @@ } }, "node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.4.tgz", + "integrity": "sha512-v8yqInVjhXyqP6+Kw4fV3ZzeMRqEW6FotRsKXjRS5VMTNIuXsdRoAvklpoRgSqXm6o9VNH4/C0mgedko9DdLsQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa" + ], "bin": { - "mime": "cli.js" + "mime": "bin/cli.js" }, "engines": { - "node": ">=10.0.0" + "node": ">=16" } }, "node_modules/mime-db": { diff --git a/package.json b/package.json index eeccf0d4..3cf8e5d3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "@testing-library/dom": "9.3.0", "@testing-library/jest-dom": "6.0.1", "@types/jest": "29.5.12", - "@types/mime": "3.0.1", "@types/node": "16.18.34", "@types/polka": "0.5.4", "@typescript-eslint/eslint-plugin": "6.4.1", @@ -51,6 +50,7 @@ "kolorist": "1.8.0", "liquidjs": "10.7.1", "magic-string": "0.30.3", + "mime": "4.0.4", "polka": "0.5.2", "preact": "10.15.1", "prettier": "3.0.2", @@ -79,7 +79,6 @@ "cjs-module-lexer": "^1.3.1", "es-module-lexer": "^1.5.4", "esbuild": "^0.19.2", - "mime": "^3.0.0", "postcss": "^8.4.28", "puppeteer": "^21.1.0", "rollup": "^3.28.1", diff --git a/rollup.config.js b/rollup.config.js index 6563e5c1..9a08b388 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -19,7 +19,6 @@ const external = [ '@rollup/plugin-commonjs', 'esbuild', /postcss/, - /mime/, '@axe-core/puppeteer', ]; diff --git a/src/module-server/middleware/static.ts b/src/module-server/middleware/static.ts index 539b8aef..8b38ca87 100644 --- a/src/module-server/middleware/static.ts +++ b/src/module-server/middleware/static.ts @@ -1,6 +1,7 @@ import { createReadStream, promises as fs } from 'node:fs'; import { posix, resolve } from 'node:path'; +// eslint-disable-next-line @cloudfour/n/file-extension-in-import import mime from 'mime/lite'; import type polka from 'polka';