basic move to snowpack

close #3
This commit is contained in:
Philipp Dormann 2020-12-22 19:53:54 +01:00
parent 7f340f2c7b
commit 663e41abec
11 changed files with 79 additions and 21 deletions

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lauf für Kaya! - Admin</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">
</head>
<body>
<script src="/env.js"></script>
<script defer type="module" src="/src/index.js"></script>
</body>
</html>

View File

@ -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"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

18
public/index.html Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Lauf Für Kaya! - Admin" />
<title>Lauf für Kaya! - Admin</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/env.js"></script>
<script defer type="module" src="/_dist_/index.js"></script>
</body>
</html>

4
public/logo.svg Normal file
View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98.1 118">
<path fill="#ff3e00" d="M91.8 15.6C80.9-.1 59.2-4.7 43.6 5.2L16.1 22.8A31.25 31.25 0 001.9 43.9c-1.3 7.3-.2 14.8 3.3 21.3-2.4 3.6-4 7.6-4.7 11.8-1.6 8.9.5 18.1 5.7 25.4 11 15.7 32.6 20.3 48.2 10.4l27.5-17.5c7.5-4.7 12.7-12.4 14.2-21.1 1.3-7.3.2-14.8-3.3-21.3 2.4-3.6 4-7.6 4.7-11.8 1.7-9-.4-18.2-5.7-25.5"/>
<path fill="#fff" d="M40.9 103.9a21.8 21.8 0 01-23.4-8.7c-3.2-4.4-4.4-9.9-3.5-15.3l.6-2.6.5-1.6 1.4 1c3.3 2.4 6.9 4.2 10.8 5.4l1 .3-.1 1c-.1 1.4.3 2.9 1.1 4.1a6.62 6.62 0 008.8 2L65.5 72c1.4-.9 2.3-2.2 2.6-3.8.3-1.6-.1-3.3-1-4.6a6.56 6.56 0 00-8.8-1.9l-10.5 6.7a18.6 18.6 0 01-5.6 2.4 21.8 21.8 0 01-23.4-8.7 20.2 20.2 0 01-3.4-15.3c.9-5.2 4.1-9.9 8.6-12.7l27.5-17.5c1.7-1.1 3.6-1.9 5.6-2.5a21.8 21.8 0 0123.4 8.7c3.2 4.4 4.4 9.9 3.5 15.3-.2.9-.4 1.7-.7 2.6l-.5 1.6-1.4-1c-3.3-2.4-6.9-4.2-10.8-5.4l-1-.3.1-1c.1-1.4-.3-2.9-1.1-4.1a6.56 6.56 0 00-8.8-1.9L32.4 46.1c-1.4.9-2.3 2.2-2.6 3.8s.1 3.3 1 4.6a6.56 6.56 0 008.8 1.9l10.5-6.7c1.7-1.1 3.6-1.9 5.6-2.5a21.8 21.8 0 0123.4 8.7c3.2 4.4 4.4 9.9 3.5 15.3-.9 5.2-4.1 9.9-8.6 12.7l-27.5 17.5c-1.7 1.1-3.6 1.9-5.6 2.5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

3
public/robots.txt Normal file
View File

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

26
snowpack.config.js Normal file
View File

@ -0,0 +1,26 @@
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public: '/',
src: '/_dist_'
},
plugins: [ '@snowpack/plugin-svelte' ],
install: [
/* ... */
],
installOptions: {
/* ... */
},
devOptions: {
/* ... */
},
buildOptions: {
/* ... */
},
proxy: {
/* ... */
},
alias: {
/* ... */
}
};

View File

@ -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({

View File

@ -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();
});
}

11
svelte.config.js Normal file
View File

@ -0,0 +1,11 @@
const sveltePreprocess = require('svelte-preprocess');
const preprocess = sveltePreprocess({
postcss: {
plugins: [ require('tailwindcss'), require('autoprefixer') ]
}
});
module.exports = {
preprocess
};