Skip to content

Commit

Permalink
update site and tests to use vite.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jul 1, 2022
1 parent 20bce80 commit 54c33f4
Show file tree
Hide file tree
Showing 23 changed files with 273 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ const config = {

prerender: {
default: true
},

vite: {
build: {
minify: false
}
}
}
};
Expand Down
12 changes: 12 additions & 0 deletions packages/adapter-static/test/apps/prerendered/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
plugins: [sveltekit()]
};

export default config;
8 changes: 1 addition & 7 deletions packages/adapter-static/test/apps/spa/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ const config = {
kit: {
adapter: adapter({
fallback: '200.html'
}),

vite: {
build: {
minify: false
}
}
})
}
};

Expand Down
12 changes: 12 additions & 0 deletions packages/adapter-static/test/apps/spa/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
plugins: [sveltekit()]
};

export default config;
14 changes: 1 addition & 13 deletions packages/kit/test/apps/amp/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@ const config = {
hydrate: false
},

inlineStyleThreshold: Infinity,

vite: {
server: {
fs: {
allow: [path.resolve('../../../src')]
},

// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost'
}
}
inlineStyleThreshold: Infinity
}
};

Expand Down
23 changes: 23 additions & 0 deletions packages/kit/test/apps/amp/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
19 changes: 0 additions & 19 deletions packages/kit/test/apps/basics/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ const config = {
prerender: {
onError: 'continue'
},
vite: {
build: {
minify: false
},
clearScreen: false,
optimizeDeps: {
// for CI, we need to explicitly prebundle deps, since
// the reload confuses Playwright
include: ['cookie', 'marked']
},
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
}
}
},
methodOverride: {
allowed: ['PUT', 'PATCH', 'DELETE']
}
Expand Down
32 changes: 32 additions & 0 deletions packages/kit/test/apps/basics/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
clearScreen: false,
optimizeDeps: {
// for CI, we need to explicitly prebundle deps, since
// the reload confuses Playwright
include: ['cookie', 'marked']
},
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
6 changes: 6 additions & 0 deletions packages/kit/test/apps/options-2/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const config = {
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};
Expand Down
14 changes: 0 additions & 14 deletions packages/kit/test/apps/options/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ const config = {
inlineStyleThreshold: 1024,
outDir: '.custom-out-dir',
trailingSlash: 'always',
vite: {
build: {
minify: false
},
clearScreen: false,
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
}
}
},
paths: {
base: '/path-base',
assets: 'https://cdn.example.com/stuff'
Expand Down
27 changes: 27 additions & 0 deletions packages/kit/test/apps/options/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
clearScreen: false,
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
12 changes: 0 additions & 12 deletions packages/kit/test/prerendering/basics/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ const config = {
prerender: {
default: true,
onError: 'continue'
},

vite: {
build: {
minify: false
},
clearScreen: false,
server: {
fs: {
allow: [path.resolve('../../../src')]
}
}
}
}
};
Expand Down
27 changes: 27 additions & 0 deletions packages/kit/test/prerendering/basics/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
clearScreen: false,
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
12 changes: 0 additions & 12 deletions packages/kit/test/prerendering/disabled/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ const config = {

prerender: {
enabled: false
},

vite: {
build: {
minify: false
},
clearScreen: false,
server: {
fs: {
allow: [path.resolve('../../../src')]
}
}
}
}
};
Expand Down
27 changes: 27 additions & 0 deletions packages/kit/test/prerendering/disabled/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
clearScreen: false,
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
14 changes: 1 addition & 13 deletions packages/kit/test/prerendering/options/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,7 @@ const config = {
default: true
},

trailingSlash: 'always',

vite: {
build: {
minify: false
},
clearScreen: false,
server: {
fs: {
allow: [path.resolve('../../../src')]
}
}
}
trailingSlash: 'always'
}
};

Expand Down
27 changes: 27 additions & 0 deletions packages/kit/test/prerendering/options/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';

/** @type {import('vite').UserConfig} */
const config = {
build: {
minify: false
},
clearScreen: false,
plugins: [sveltekit()],
server: {
// TODO: required to support ipv6, remove on vite 3
// https://github.com/vitejs/vite/issues/7075
host: 'localhost',
fs: {
allow: [path.resolve('../../../src')]
},
// TODO: remove on vite 3
// https://github.com/vitejs/vite/pull/8778
watch: {
// perf, do not watch playwright output dir
ignored: ['**/test-results/**']
}
}
};

export default config;
12 changes: 0 additions & 12 deletions packages/kit/test/prerendering/paths-base/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ const config = {

prerender: {
default: true
},

vite: {
build: {
minify: false
},
clearScreen: false,
server: {
fs: {
allow: [path.resolve('../../../src')]
}
}
}
}
};
Expand Down
Loading

0 comments on commit 54c33f4

Please sign in to comment.