@svelte-vitals/vite 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -6
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
SITEMAP_SOURCE_PATHS,
|
|
81
81
|
SVELTE_CONFIG_FILES,
|
|
82
82
|
VITE_CONFIG_FILES,
|
|
83
|
+
resolveKitAliases,
|
|
83
84
|
resolveKitPathsBase
|
|
84
85
|
} from "@svelte-vitals/core";
|
|
85
86
|
async function exists(path) {
|
|
@@ -122,12 +123,14 @@ async function collectRenderedProject(cwd, htmlLang) {
|
|
|
122
123
|
]);
|
|
123
124
|
const robotsReferencesSitemap = await robotsRefsSitemap(cwd);
|
|
124
125
|
const kitPathsBase = resolveKitPathsBase(viteConfig, svelteConfig);
|
|
126
|
+
const kitAliases = resolveKitAliases(viteConfig, svelteConfig);
|
|
125
127
|
return {
|
|
126
128
|
hasRobotsTxt,
|
|
127
129
|
hasSitemap,
|
|
128
130
|
htmlLang,
|
|
129
131
|
...robotsReferencesSitemap !== void 0 ? { robotsReferencesSitemap } : {},
|
|
130
|
-
...kitPathsBase ? { kitPathsBase } : {}
|
|
132
|
+
...kitPathsBase ? { kitPathsBase } : {},
|
|
133
|
+
...kitAliases ? { kitAliases } : {}
|
|
131
134
|
};
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -137,7 +140,8 @@ import { join as join3 } from "path";
|
|
|
137
140
|
import { glob as glob2 } from "tinyglobby";
|
|
138
141
|
import {
|
|
139
142
|
collectComponentFacts as collect,
|
|
140
|
-
collectKitModuleFacts as collectKit
|
|
143
|
+
collectKitModuleFacts as collectKit,
|
|
144
|
+
collectSourceFiles as collectFiles
|
|
141
145
|
} from "@svelte-vitals/core";
|
|
142
146
|
var nodeRuntime = {
|
|
143
147
|
readFile: (path) => readFile3(path, "utf8"),
|
|
@@ -155,8 +159,11 @@ var nodeRuntime = {
|
|
|
155
159
|
function collectComponentFacts(root) {
|
|
156
160
|
return collect(nodeRuntime, root);
|
|
157
161
|
}
|
|
158
|
-
function collectKitModuleFacts(root) {
|
|
159
|
-
return collectKit(nodeRuntime, root);
|
|
162
|
+
function collectKitModuleFacts(root, aliases) {
|
|
163
|
+
return collectKit(nodeRuntime, root, aliases);
|
|
164
|
+
}
|
|
165
|
+
function collectSourceFiles(root) {
|
|
166
|
+
return collectFiles(nodeRuntime, root);
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
// src/version.ts
|
|
@@ -200,7 +207,8 @@ async function analyze(prerenderPagesDir, cwd, options, extraProjectFacts) {
|
|
|
200
207
|
...extraProjectFacts
|
|
201
208
|
};
|
|
202
209
|
const components = await collectComponentFacts(cwd);
|
|
203
|
-
const kitModules = await collectKitModuleFacts(cwd);
|
|
210
|
+
const kitModules = await collectKitModuleFacts(cwd, project.kitAliases);
|
|
211
|
+
const sourceFiles = await collectSourceFiles(cwd);
|
|
204
212
|
const results = applyOverrides(
|
|
205
213
|
applyRuleSeverities(
|
|
206
214
|
await runRules(selectRules(allRules, config), {
|
|
@@ -210,7 +218,8 @@ async function analyze(prerenderPagesDir, cwd, options, extraProjectFacts) {
|
|
|
210
218
|
project,
|
|
211
219
|
components,
|
|
212
220
|
config,
|
|
213
|
-
kitModules
|
|
221
|
+
kitModules,
|
|
222
|
+
sourceFiles
|
|
214
223
|
}),
|
|
215
224
|
config
|
|
216
225
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-vitals/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Vite/SvelteKit plugin for svelte-vitals — analyzes prerendered HTML during vite build.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"esm-env": "^1.2.2",
|
|
43
43
|
"node-html-parser": "^9.0.0",
|
|
44
44
|
"tinyglobby": "^0.2.17",
|
|
45
|
-
"
|
|
46
|
-
"svelte-vitals": "0.
|
|
45
|
+
"svelte-vitals": "0.35.0",
|
|
46
|
+
"@svelte-vitals/core": "0.31.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@sveltejs/kit": "^2.70.1",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "tsup",
|
|
66
|
+
"bench": "node scripts/bench/bench.mjs",
|
|
66
67
|
"typecheck": "tsc --noEmit",
|
|
67
68
|
"test": "vitest run"
|
|
68
69
|
}
|