@sveltejs/kit 2.5.7 → 2.5.9
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/package.json
CHANGED
|
@@ -192,7 +192,13 @@ const value_regex = /^(.*?)((\/\*)|(\.\w+))?$/;
|
|
|
192
192
|
*/
|
|
193
193
|
function get_tsconfig_paths(config) {
|
|
194
194
|
/** @param {string} file */
|
|
195
|
-
const config_relative = (file) =>
|
|
195
|
+
const config_relative = (file) => {
|
|
196
|
+
let relative_path = path.relative(config.outDir, file);
|
|
197
|
+
if (!relative_path.startsWith('..')) {
|
|
198
|
+
relative_path = './' + relative_path;
|
|
199
|
+
}
|
|
200
|
+
return posixify(relative_path);
|
|
201
|
+
};
|
|
196
202
|
|
|
197
203
|
const alias = { ...config.alias };
|
|
198
204
|
if (fs.existsSync(project_relative(config.files.lib))) {
|
|
@@ -293,6 +293,7 @@ async function kit({ svelte_config }) {
|
|
|
293
293
|
cors: { preflightContinue: true }
|
|
294
294
|
},
|
|
295
295
|
optimizeDeps: {
|
|
296
|
+
entries: [`${kit.files.routes}/**/+*.{svelte,js,ts}`],
|
|
296
297
|
exclude: [
|
|
297
298
|
'@sveltejs/kit',
|
|
298
299
|
// exclude kit features so that libraries using them work even when they are prebundled
|
|
@@ -2027,7 +2027,7 @@ function _start_router() {
|
|
|
2027
2027
|
}
|
|
2028
2028
|
|
|
2029
2029
|
/** @param {MouseEvent} event */
|
|
2030
|
-
container.addEventListener('click', (event) => {
|
|
2030
|
+
container.addEventListener('click', async (event) => {
|
|
2031
2031
|
// Adapted from https://github.com/visionmedia/page.js
|
|
2032
2032
|
// MIT license https://github.com/visionmedia/page.js#license
|
|
2033
2033
|
if (event.button || event.which !== 1) return;
|
|
@@ -2120,6 +2120,16 @@ function _start_router() {
|
|
|
2120
2120
|
|
|
2121
2121
|
event.preventDefault();
|
|
2122
2122
|
|
|
2123
|
+
// allow the browser to repaint before navigating —
|
|
2124
|
+
// this prevents INP scores being penalised
|
|
2125
|
+
await new Promise((fulfil) => {
|
|
2126
|
+
requestAnimationFrame(() => {
|
|
2127
|
+
setTimeout(fulfil, 0);
|
|
2128
|
+
});
|
|
2129
|
+
|
|
2130
|
+
setTimeout(fulfil, 100); // fallback for edge case where rAF doesn't fire because e.g. tab was backgrounded
|
|
2131
|
+
});
|
|
2132
|
+
|
|
2123
2133
|
navigate({
|
|
2124
2134
|
type: 'link',
|
|
2125
2135
|
url,
|
package/src/version.js
CHANGED