@sveltejs/kit 1.0.0-next.532 → 1.0.0-next.533

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": "1.0.0-next.532",
3
+ "version": "1.0.0-next.533",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "peerDependencies": {
43
43
  "svelte": "^3.44.0",
44
- "vite": "^3.1.0"
44
+ "vite": "^3.2.0"
45
45
  },
46
46
  "bin": {
47
47
  "svelte-kit": "svelte-kit.js"
@@ -257,15 +257,13 @@ const options = object(
257
257
 
258
258
  // TODO: remove this for the 1.0 release
259
259
  force: validate(undefined, (input, keypath) => {
260
- if (typeof input !== 'undefined') {
261
- const new_input = input ? 'warn' : 'fail';
262
- const needs_option = new_input === 'warn';
263
- throw new Error(
264
- `${keypath} has been removed in favor of \`handleHttpError\`. In your case, set \`handleHttpError\` to "${new_input}"${
265
- needs_option ? '' : ' (or leave it undefined)'
266
- } to get the same behavior as you would with \`force: ${JSON.stringify(input)}\``
267
- );
268
- }
260
+ const new_input = input ? 'warn' : 'fail';
261
+ const needs_option = new_input === 'warn';
262
+ throw new Error(
263
+ `${keypath} has been removed in favor of \`handleHttpError\`. In your case, set \`handleHttpError\` to "${new_input}"${
264
+ needs_option ? '' : ' (or leave it undefined)'
265
+ } to get the same behavior as you would with \`force: ${JSON.stringify(input)}\``
266
+ );
269
267
  }),
270
268
 
271
269
  handleHttpError: validate('fail', (input, keypath) => {
@@ -282,15 +280,13 @@ const options = object(
282
280
 
283
281
  // TODO: remove this for the 1.0 release
284
282
  onError: validate(undefined, (input, keypath) => {
285
- if (typeof input !== 'undefined') {
286
- let message = `${keypath} has been renamed to \`handleHttpError\``;
287
-
288
- if (input === 'continue') {
289
- message += ', and "continue" has been renamed to "warn"';
290
- }
283
+ let message = `${keypath} has been renamed to \`handleHttpError\``;
291
284
 
292
- throw new Error(message);
285
+ if (input === 'continue') {
286
+ message += ', and "continue" has been renamed to "warn"';
293
287
  }
288
+
289
+ throw new Error(message);
294
290
  }),
295
291
 
296
292
  origin: validate('http://sveltekit-prerender', (input, keypath) => {
@@ -432,8 +428,6 @@ function string(fallback, allow_empty = true) {
432
428
  */
433
429
  function string_array(fallback) {
434
430
  return validate(fallback, (input, keypath) => {
435
- if (input === undefined) return input;
436
-
437
431
  if (!Array.isArray(input) || input.some((value) => typeof value !== 'string')) {
438
432
  throw new Error(`${keypath} must be an array of strings, if specified`);
439
433
  }
@@ -511,10 +505,8 @@ function assert_string(input, keypath) {
511
505
 
512
506
  /** @param {(keypath?: string) => string} fn */
513
507
  function error(fn) {
514
- return validate(undefined, (input, keypath) => {
515
- if (input !== undefined) {
516
- throw new Error(fn(keypath));
517
- }
508
+ return validate(undefined, (_, keypath) => {
509
+ throw new Error(fn(keypath));
518
510
  });
519
511
  }
520
512
 
@@ -7,6 +7,7 @@ import { parse_route_id } from '../../../utils/routing.js';
7
7
  import { sort_routes } from './sort.js';
8
8
 
9
9
  /**
10
+ * Generates the manifest data used for the client-side manifest and types generation.
10
11
  * @param {{
11
12
  * config: import('types').ValidatedConfig;
12
13
  * fallback?: string;
@@ -115,8 +115,10 @@ export function get_default_build_config({ config, input, ssr, outDir }) {
115
115
  cssCodeSplit: true,
116
116
  // don't use the default name to avoid collisions with 'static/manifest.json'
117
117
  manifest: 'vite-manifest.json',
118
+ modulePreload: {
119
+ polyfill: false
120
+ },
118
121
  outDir,
119
- polyfillModulePreload: false,
120
122
  rollupOptions: {
121
123
  input,
122
124
  output: {
@@ -34,8 +34,10 @@ const enforced_config = {
34
34
  formats: true
35
35
  },
36
36
  manifest: true,
37
+ modulePreload: {
38
+ polyfill: true
39
+ },
37
40
  outDir: true,
38
- polyfillModulePreload: true,
39
41
  rollupOptions: {
40
42
  input: true,
41
43
  output: {