Skip to content

Commit 40b8dab

Browse files
committed
chore: remove unused files & code
1 parent 210ff7c commit 40b8dab

File tree

4 files changed

+0
-326
lines changed

4 files changed

+0
-326
lines changed

packages/vite-plugin-svelte/src/handle-hot-update.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

packages/vite-plugin-svelte/src/utils/dependencies.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
import path from 'node:path';
2-
import fs from 'node:fs/promises';
3-
import { findDepPkgJsonPath } from 'vitefu';
4-
5-
/**
6-
* @typedef {{
7-
* dir: string;
8-
* pkg: Record<string, any>;
9-
* }} DependencyData
10-
*/
11-
12-
/**
13-
* @param {string} dep
14-
* @param {string} parent
15-
* @returns {Promise<DependencyData | undefined>}
16-
*/
17-
export async function resolveDependencyData(dep, parent) {
18-
const depDataPath = await findDepPkgJsonPath(dep, parent);
19-
if (!depDataPath) return undefined;
20-
try {
21-
return {
22-
dir: path.dirname(depDataPath),
23-
pkg: JSON.parse(await fs.readFile(depDataPath, 'utf-8'))
24-
};
25-
} catch {
26-
return undefined;
27-
}
28-
}
29-
301
const COMMON_DEPENDENCIES_WITHOUT_SVELTE_FIELD = [
312
'@lukeed/uuid',
323
'@playwright/test',

packages/vite-plugin-svelte/src/utils/load-raw.js

Lines changed: 0 additions & 125 deletions
This file was deleted.

packages/vite-plugin-svelte/src/utils/preprocess.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
1-
import MagicString from 'magic-string';
21
import { log } from './log.js';
3-
import path from 'node:path';
42
import { normalizePath } from 'vite';
53

6-
/**
7-
* this appends a *{} rule to component styles to force the svelte compiler to add style classes to all nodes
8-
* That means adding/removing class rules from <style> node won't trigger js updates as the scope classes are not changed
9-
*
10-
* only used during dev with enabled css hmr
11-
*
12-
* @returns {import('svelte/compiler').PreprocessorGroup}
13-
*/
14-
export function createInjectScopeEverythingRulePreprocessorGroup() {
15-
return {
16-
name: 'inject-scope-everything-rule',
17-
style({ content, filename }) {
18-
const s = new MagicString(content);
19-
s.append(' *{}');
20-
return {
21-
code: s.toString(),
22-
map: s.generateDecodedMap({
23-
source: filename ? path.basename(filename) : undefined,
24-
hires: true
25-
})
26-
};
27-
}
28-
};
29-
}
30-
314
/**
325
* @param {import('../types/options.d.ts').ResolvedOptions} options
336
* @param {import('vite').ResolvedConfig} config

0 commit comments

Comments
 (0)