Skip to content

Commit afed227

Browse files
authored
chore: fix docs build (#1375)
1 parent 426cc10 commit afed227

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

docs-svelte-kit/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@shikijs/twoslash": "^3.12.2",
2121
"@sindresorhus/slugify": "^3.0.0",
2222
"@sveltejs/adapter-static": "^3.0.9",
23-
"@sveltejs/kit": "^2.37.0",
23+
"@sveltejs/kit": "^2.43.1",
2424
"@sveltejs/vite-plugin-svelte": "^6.1.4",
2525
"@types/babel__core": "^7.20.5",
2626
"@types/cross-spawn": "^6.0.6",
@@ -57,7 +57,6 @@
5757
"source-map-js": "^1.2.1",
5858
"stylus": "^0.64.0",
5959
"svelte": "^5.38.6",
60-
"svelte-adapter-ghpages": "0.2.2",
6160
"twoslash-eslint": "^0.3.4",
6261
"twoslash-protocol": "^0.3.4",
6362
"util": "^0.12.5",

docs-svelte-kit/svelte.config.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
1-
import ghpagesAdapter from 'svelte-adapter-ghpages';
2-
import path from 'path';
3-
import { fileURLToPath } from 'url';
1+
import adapter from '@sveltejs/adapter-static';
42

53
if (typeof self === 'undefined') {
64
globalThis.self = globalThis;
75
}
86

9-
const dirname = path.dirname(fileURLToPath(import.meta.url));
10-
11-
const outDir = path.join(dirname, 'build/eslint-plugin-svelte');
12-
137
/** @type {import('@sveltejs/kit').Config} */
148
const config = {
159
compilerOptions: {
16-
preserveWhitespace: true
10+
preserveWhitespace: true,
11+
warningFilter: (warning) => {
12+
if (warning.code === 'a11y_no_noninteractive_tabindex') return false;
13+
return true;
14+
}
1715
},
1816
extensions: ['.svelte', '.md'],
1917
kit: {
18+
adapter: adapter({
19+
fallback: '404.html'
20+
}),
2021
paths: {
21-
base: '/eslint-plugin-svelte',
22-
relative: false
23-
},
24-
adapter: ghpagesAdapter({
25-
// default options are shown
26-
pages: outDir,
27-
assets: outDir
28-
})
22+
base: '/eslint-plugin-svelte'
23+
}
2924
}
3025
};
3126
export default config;

docs-svelte-kit/vite.config.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { sveltekit } from '@sveltejs/kit/vite';
22
import path from 'path';
3-
// @ts-expect-error -- Missing types
43
import svelteMd from 'vite-plugin-svelte-md';
54
import { rules as pluginRules } from 'eslint-plugin-svelte';
65
import svelteMdOption from './tools/vite-plugin-svelte-md-option.mjs';
76

87
import generateRoutes from './tools/generate-routes.mjs';
9-
import type { UserConfig } from 'vite';
8+
import { createLogger, type UserConfig } from 'vite';
109
import { fileURLToPath } from 'url';
1110

1211
generateRoutes();
1312

1413
const dirname = path.dirname(fileURLToPath(import.meta.url));
1514

15+
const logger = createLogger();
16+
1617
/** @type {import('vite').UserConfig} */
1718
const config: UserConfig = {
1819
plugins: [
@@ -38,6 +39,16 @@ const config: UserConfig = {
3839
commonjsOptions: {
3940
ignoreDynamicRequires: true
4041
}
42+
},
43+
44+
customLogger: {
45+
...logger,
46+
warn(msg, options) {
47+
if (msg.includes('vite-plugin-svelte-md') && msg.includes('was used to transform files')) {
48+
return;
49+
}
50+
logger.warn(msg, options);
51+
}
4152
}
4253
};
4354

0 commit comments

Comments
 (0)