@sveltejs/kit 2.5.8 → 2.5.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "2.5.8",
3
+ "version": "2.5.10",
4
4
  "description": "The fastest way to build Svelte apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "cookie": "^0.6.0",
16
16
  "devalue": "^5.0.0",
17
17
  "esm-env": "^1.0.0",
18
- "import-meta-resolve": "^4.0.0",
18
+ "import-meta-resolve": "^4.1.0",
19
19
  "kleur": "^4.1.5",
20
20
  "magic-string": "^0.30.5",
21
21
  "mrmime": "^2.0.0",
@@ -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) => posixify(path.relative(config.outDir, 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,7 +293,10 @@ async function kit({ svelte_config }) {
293
293
  cors: { preflightContinue: true }
294
294
  },
295
295
  optimizeDeps: {
296
- entries: [`${kit.files.routes}/**/+*.{svelte,js,ts}`],
296
+ entries: [
297
+ `${kit.files.routes}/**/+*.{svelte,js,ts}`,
298
+ `!${kit.files.routes}/**/+*server.*`
299
+ ],
297
300
  exclude: [
298
301
  '@sveltejs/kit',
299
302
  // 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
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '2.5.8';
4
+ export const VERSION = '2.5.10';