Skip to content

Commit

Permalink
with sveltejs/kit#5184, svelte-kit dev is no longer valid and all vit…
Browse files Browse the repository at this point in the history
…e config options have been moved to vite.config.js
  • Loading branch information
Dilden committed Jul 6, 2022
1 parent 2ac25da commit 944516b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 37 deletions.
13 changes: 3 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "helth",
"version": "0.0.1",
"scripts": {
"dev": "svelte-kit dev --https",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"dev": "vite dev --https",
"build": "vite build",
"package": "vite package",
"preview": "vite preview",
"prepare": "vite sync",
"test": "playwright test",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
Expand All @@ -21,6 +21,7 @@
"prettier": "^2.5.1",
"prettier-plugin-svelte": "^2.5.0",
"svelte": "^3.44.0",
"vite": "^2.9.13",
"vite-plugin-pwa": "^0.12.2"
},
"type": "module",
Expand Down
23 changes: 1 addition & 22 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import adapter from '@sveltejs/adapter-node';
import path from 'path';
import { VitePWA } from 'vite-plugin-pwa';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -11,26 +9,7 @@ const config = {
prerender: {
default: true
},
trailingSlash: 'always',
vite: {
plugins: [
VitePWA({ registerType: 'autoUpdate'})
],
server: {
fs: {
allow: ['static']
}
},
resolve: {
alias: {
// set an alias so images can be dynamically imported
$static: path.resolve('./static'),
$components: path.resolve('./src/components'),
$utils: path.resolve('./src/utils'),
$stores: path.resolve('./src/stores')
}
}
}
trailingSlash: 'always'
}
};

Expand Down
29 changes: 29 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import path from 'path';
import { VitePWA } from 'vite-plugin-pwa';


/** @type {import('vite').UserConfig} */
const config = {
plugins: [
sveltekit(),
VitePWA({ registerType: 'autoUpdate'})
],
server: {
fs: {
allow: ['static']
}
},
resolve: {
alias: {
// set an alias so images can be dynamically imported
$static: path.resolve('./static'),
$components: path.resolve('./src/components'),
$utils: path.resolve('./src/utils'),
$stores: path.resolve('./src/stores')
}
}
};

export default config;

0 comments on commit 944516b

Please sign in to comment.