diff --git a/index.html b/index.html deleted file mode 100644 index 3dd0d0cc..00000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Lauf für Kaya! - Admin - - - - - - - diff --git a/package.json b/package.json index a2dd1fb2..a2bd6ded 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,8 @@ "name": "@odit/lfk-frontend", "version": "0.0.0", "scripts": { - "dev": "svite", - "build": "svite build", - "start": "svite serve" + "dev": "snowpack dev", + "build": "snowpack build" }, "dependencies": { "@odit/lfk-client-js": "^0.0.4", @@ -15,8 +14,12 @@ "validator": "^13.5.2" }, "devDependencies": { + "snowpack": "^2.17.1", + "@snowpack/plugin-svelte": "^3.3.0", + "autoprefixer": "^10.0.4", + "postcss": "^8.1.10", + "postcss-load-config": "^3.0.0", "svelte": "^3.31.0", - "svelte-hmr": "^0.12.2", - "svite": "^0.8.1" + "svelte-preprocess": "^4.1.1" } } diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..d75d248e Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 00000000..481f5263 Binary files /dev/null and b/public/favicon.png differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 00000000..925fc8a5 --- /dev/null +++ b/public/index.html @@ -0,0 +1,18 @@ + + + + + + + + + Lauf für Kaya! - Admin + + + + + + + + + \ No newline at end of file diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 00000000..c051f1a3 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..e9e57dc4 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/snowpack.config.js b/snowpack.config.js new file mode 100644 index 00000000..b52a2921 --- /dev/null +++ b/snowpack.config.js @@ -0,0 +1,26 @@ +/** @type {import("snowpack").SnowpackUserConfig } */ +module.exports = { + mount: { + public: '/', + src: '/_dist_' + }, + plugins: [ '@snowpack/plugin-svelte' ], + install: [ + /* ... */ + ], + installOptions: { + /* ... */ + }, + devOptions: { + /* ... */ + }, + buildOptions: { + /* ... */ + }, + proxy: { + /* ... */ + }, + alias: { + /* ... */ + } +}; diff --git a/src/App.svelte b/src/App.svelte index e9ee6b4c..6ee0412a 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,8 +4,8 @@ import { replace } from "svelte-spa-router"; import { wrap } from "svelte-spa-router/wrap"; import { addMessages, init, getLocaleFromNavigator } from "svelte-i18n"; - import en from "./locales/en"; - import de from "./locales/de"; + import en from "./locales/en.json"; + import de from "./locales/de.json"; addMessages("en", en); addMessages("de", de); init({ diff --git a/src/index.js b/src/index.js index 2c27a257..c17a54f5 100644 --- a/src/index.js +++ b/src/index.js @@ -5,3 +5,10 @@ const app = new App({ }); export default app; +// HMR +if (import.meta.hot) { + import.meta.hot.accept(); + import.meta.hot.dispose(() => { + app.$destroy(); + }); +} diff --git a/svelte.config.js b/svelte.config.js new file mode 100644 index 00000000..c331e4a8 --- /dev/null +++ b/svelte.config.js @@ -0,0 +1,11 @@ +const sveltePreprocess = require('svelte-preprocess'); + +const preprocess = sveltePreprocess({ + postcss: { + plugins: [ require('tailwindcss'), require('autoprefixer') ] + } +}); + +module.exports = { + preprocess +};