Skip to content

Commit b8f75f0

Browse files
committed
[chore] adapter-node: minor typing improvements
1 parent 0bc6648 commit b8f75f0

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

packages/adapter-node/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"devDependencies": {
2828
"@rollup/plugin-json": "^4.1.0",
2929
"@sveltejs/kit": "workspace:*",
30+
"@types/compression": "^1.7.1",
3031
"c8": "^7.7.2",
3132
"compression": "^1.7.4",
3233
"node-fetch": "^3.0.0-beta.9",

packages/adapter-node/src/server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { fileURLToPath } from 'url';
99
// App is a dynamic file built from the application layer.
1010

1111
const __dirname = dirname(fileURLToPath(import.meta.url));
12+
/** @type {import('polka').Middleware} */
1213
const noop_handler = (_req, _res, next) => next();
1314
const paths = {
1415
assets: join(__dirname, '/assets'),
@@ -28,8 +29,8 @@ export function createServer({ render }) {
2829
const assets_handler = fs.existsSync(paths.assets)
2930
? sirv(paths.assets, {
3031
setHeaders: (res, pathname, stats) => {
31-
// eslint-disable-next-line no-undef
32-
if (pathname.startsWith(APP_DIR)) {
32+
// @ts-ignore
33+
if (pathname.startsWith(APP_DIR)) { // eslint-disable-line no-undef
3334
res.setHeader('cache-control', 'public, max-age=31536000, immutable');
3435
}
3536
},

pnpm-lock.yaml

+57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)