Skip to content

Commit ab6a854

Browse files
committed
fix(build): add SCSS preprocessing and suppress dependency warnings
- Add svelte-preprocess for SCSS support in svelma - Install postcss and postcss-load-config - Suppress accessibility and CSS warnings in vite config - Configure SCSS preprocessing for Tooltip Known: svelte-jsoneditor TransformWizard has invalid HTML Related: #286
1 parent b03f48f commit ab6a854

3 files changed

Lines changed: 5438 additions & 13 deletions

File tree

desktop/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@
7272
"dotenv": "^16.4.5",
7373
"jsdom": "^25.0.1",
7474
"patch-package": "^8.0.0",
75+
"postcss": "^8.5.6",
76+
"postcss-load-config": "^6.0.1",
7577
"sass": "^1.83.0",
7678
"selenium-webdriver": "^4.21.0",
7779
"svelte": "^5.2.8",
7880
"svelte-check": "^4.0.0",
79-
"svelte-preprocess": "^5.1.0",
81+
"svelte-preprocess": "^6.0.3",
8082
"svelte-typeahead": "^4.4.1",
8183
"tslib": "^2.8.1",
8284
"typescript": "^5.0.4",

desktop/vite.config.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from 'vite'
22
import { svelte } from '@sveltejs/vite-plugin-svelte'
3+
import sveltePreprocess from 'svelte-preprocess'
34
import { fileURLToPath, URL } from "url";
45
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
56
import { resolve } from 'path';
@@ -11,22 +12,18 @@ export default defineConfig({
1112
compilerOptions: {
1213
css: 'injected'
1314
},
15+
preprocess: sveltePreprocess({
16+
scss: true
17+
}),
1418
onwarn: (warning, handler) => {
15-
// Ignore svelma warnings
19+
// Ignore dependency warnings
1620
if (warning.code === 'css_nesting_selector_invalid_placement') return;
1721
if (warning.code === 'css_invalid_global') return;
22+
if (warning.code === 'a11y_consider_explicit_label') return;
23+
if (warning.code === 'a11y_label_has_associated_control') return;
24+
if (warning.code === 'a11y_click_events_have_key_events') return;
25+
if (warning.code === 'node_invalid_placement') return;
1826
handler(warning);
19-
},
20-
preprocess: {
21-
style: ({ content, filename }) => {
22-
// Handle problematic CSS nesting in svelma
23-
if (filename && filename.includes('svelma')) {
24-
return {
25-
code: content.replace(/:global\(&\[([^\]]+)\]\)/g, '&[$1]')
26-
};
27-
}
28-
return { code: content };
29-
}
3027
}
3128
}),
3229
],

0 commit comments

Comments
 (0)