parent
3d4dc2d72b
commit
ae79e9fea1
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,5 @@ yarn.lock
|
|||||||
public/env.js
|
public/env.js
|
||||||
public/sw.js
|
public/sw.js
|
||||||
public/index.html
|
public/index.html
|
||||||
public/workbox-*.js
|
|
||||||
svelte.config.js
|
svelte.config.js
|
||||||
public/index.html
|
public/index.html
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/favicon.png" />
|
<link rel="icon" href="/favicon.png" />
|
||||||
<link rel="manifest" href="/manifest.webmanifest">
|
<link rel="manifest" href="/manifest.webmanifest">
|
||||||
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
||||||
<meta name="theme-color" content="#FFFFFF">
|
<meta name="theme-color" content="#FFFFFF">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="description" content="Lauf Für Kaya! - Admin" />
|
<meta name="description" content="Lauf Für Kaya! - Admin" />
|
||||||
<title>Lauf für Kaya! - Admin</title>
|
<title>Lauf für Kaya! - Admin</title>
|
||||||
__TAILWIND_INSERT__
|
</head>
|
||||||
</head>
|
|
||||||
|
<body>
|
||||||
<body>
|
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.8.4-RELEASE_INFO</span>
|
||||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.8.4-RELEASE_INFO</span>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<script src="/env.js"></script>
|
||||||
<script src="/env.js"></script>
|
<script type="module" src="./src/main.js"></script>
|
||||||
<script defer type="module" src="/_dist_/index.js"></script>
|
</body>
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
</html>
|
17
package.json
17
package.json
@ -3,11 +3,8 @@
|
|||||||
"version": "0.8.4",
|
"version": "0.8.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"i18n-order": "node order.js",
|
"i18n-order": "node order.js",
|
||||||
"dev:all": "yarn prebuild && snowpack dev",
|
"dev": "vite dev",
|
||||||
"dev": "cross-env NODE_ENV_ODIT=development_fast node template-copy.js && yarn build:sw && snowpack dev",
|
"build": "vite build",
|
||||||
"build": "yarn prebuild && snowpack build",
|
|
||||||
"prebuild": "cross-env NODE_ENV_ODIT=production node template-copy.js && yarn build:sw",
|
|
||||||
"build:sw": "workbox generateSW workbox-config.js",
|
|
||||||
"release": "release-it",
|
"release": "release-it",
|
||||||
"licenses:export": "license-exporter --json -o public"
|
"licenses:export": "license-exporter --json -o public"
|
||||||
},
|
},
|
||||||
@ -29,17 +26,19 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@odit/license-exporter": "^0.0.11",
|
"@odit/license-exporter": "^0.0.11",
|
||||||
"@snowpack/plugin-svelte": "3.5.2",
|
|
||||||
"auto-changelog": "^2.2.1",
|
"auto-changelog": "^2.2.1",
|
||||||
"autoprefixer": "10.2.5",
|
"autoprefixer": "10.2.5",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"postcss": "8.2.8",
|
"postcss": "8.2.8",
|
||||||
"postcss-load-config": "3.0.1",
|
"postcss-load-config": "3.0.1",
|
||||||
"release-it": "^14.4.1",
|
"release-it": "^14.4.1",
|
||||||
"snowpack": "3.0.13",
|
|
||||||
"svelte": "3.35.0",
|
"svelte": "3.35.0",
|
||||||
"svelte-preprocess": "4.6.9",
|
"svelte-preprocess": "4.6.9",
|
||||||
"workbox-cli": "6.1.2"
|
"vite": "^2.1.2",
|
||||||
|
"vite-plugin-windicss": "^0.9.6",
|
||||||
|
"@svitejs/vite-plugin-svelte": "^0.11.1",
|
||||||
|
"@types/html-minifier": "^4.0.0",
|
||||||
|
"html-minifier": "^4.0.0"
|
||||||
},
|
},
|
||||||
"release-it": {
|
"release-it": {
|
||||||
"git": {
|
"git": {
|
||||||
@ -55,7 +54,7 @@
|
|||||||
"publish": false
|
"publish": false
|
||||||
},
|
},
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"after:bump": "npx auto-changelog --commit-limit false -p -u --hide-credit && git add CHANGELOG.md && node versionbuilder.js && git add index.template.html && node order.js && git add src/locales"
|
"after:bump": "npx auto-changelog --commit-limit false -p -u --hide-credit && git add CHANGELOG.md && node versionbuilder.js && git add index.html && node order.js && git add src/locales"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
const sveltePreprocess = require('svelte-preprocess');
|
|
||||||
const preprocess = sveltePreprocess(__insert__);
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preprocess
|
|
||||||
};
|
|
@ -1,26 +0,0 @@
|
|||||||
/** @type {import("snowpack").SnowpackUserConfig } */
|
|
||||||
module.exports = {
|
|
||||||
mount: {
|
|
||||||
public: '/',
|
|
||||||
src: '/_dist_'
|
|
||||||
},
|
|
||||||
plugins: [ '@snowpack/plugin-svelte' ],
|
|
||||||
routes: [
|
|
||||||
/* Enable an SPA Fallback in development: */
|
|
||||||
{ match: 'routes', src: '.*', dest: '/index.html' }
|
|
||||||
],
|
|
||||||
packageOptions: {
|
|
||||||
/* ... */
|
|
||||||
sourceMap: false
|
|
||||||
},
|
|
||||||
devOptions: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
buildOptions: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
alias: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
optimize: { bundle: true, minify: true }
|
|
||||||
};
|
|
@ -1,14 +1,13 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
purge: {
|
|
||||||
content: [ './src/**/*.svelte' ]
|
|
||||||
},
|
|
||||||
// darkMode: 'media',
|
|
||||||
variants: {},
|
|
||||||
plugins: [],
|
|
||||||
theme: {
|
theme: {
|
||||||
container: {
|
extend: {
|
||||||
center: true,
|
colors: {
|
||||||
padding: '1.5rem'
|
reepolee: {
|
||||||
|
500: '#b40000',
|
||||||
|
600: '#9c0000',
|
||||||
|
700: '#750000'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
let content_svelteconfig = fs.readFileSync('./s-config.template.js', { encoding: 'utf8' });
|
|
||||||
let content_html = fs.readFileSync('./index.template.html', { encoding: 'utf8' });
|
|
||||||
if (process.env.NODE_ENV_ODIT == 'development_fast') {
|
|
||||||
content_html = content_html.replace(
|
|
||||||
'__TAILWIND_INSERT__',
|
|
||||||
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">'
|
|
||||||
);
|
|
||||||
content_svelteconfig = content_svelteconfig.replace('__insert__', '{postcss:{}}');
|
|
||||||
} else {
|
|
||||||
content_html = content_html.replace('__TAILWIND_INSERT__', '');
|
|
||||||
content_svelteconfig = content_svelteconfig.replace(
|
|
||||||
'__insert__',
|
|
||||||
"{postcss:{plugins:[require('tailwindcss'),require('autoprefixer')]}}"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
fs.writeFileSync('./public/index.html', content_html);
|
|
||||||
fs.writeFileSync('./svelte.config.js', content_svelteconfig);
|
|
||||||
console.info('dev setup script done');
|
|
@ -1,5 +1,5 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const package = JSON.parse(fs.readFileSync(`./package.json`, { encoding: 'utf-8' }));
|
const package = JSON.parse(fs.readFileSync(`./package.json`, { encoding: 'utf-8' }));
|
||||||
const original = fs.readFileSync(`./index.template.html`, { encoding: 'utf-8' });
|
const original = fs.readFileSync(`./index.html`, { encoding: 'utf-8' });
|
||||||
let out = original.replace(/RELEASE_INFO-(\S)+-RELEASE_INFO/gi, 'RELEASE_INFO-' + package.version + '-RELEASE_INFO');
|
let out = original.replace(/RELEASE_INFO-(\S)+-RELEASE_INFO/gi, 'RELEASE_INFO-' + package.version + '-RELEASE_INFO');
|
||||||
fs.writeFileSync(`./index.template.html`, out);
|
fs.writeFileSync(`./index.html`, out);
|
||||||
|
50
vite.config.js
Normal file
50
vite.config.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import svelte from '@svitejs/vite-plugin-svelte';
|
||||||
|
import windiCSS from 'vite-plugin-windicss';
|
||||||
|
import { minify } from 'html-minifier';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
//
|
||||||
|
const indexReplace = () => {
|
||||||
|
return {
|
||||||
|
name: 'html-transform',
|
||||||
|
transformIndexHtml(html) {
|
||||||
|
return minify(html, {
|
||||||
|
collapseWhitespace: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineConfig(({ command, mode }) => {
|
||||||
|
const isProduction = mode === 'production';
|
||||||
|
return {
|
||||||
|
base: './',
|
||||||
|
build: {
|
||||||
|
polyfillDynamicImport: false,
|
||||||
|
cssCodeSplit: false,
|
||||||
|
minify: isProduction
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
windiCSS({
|
||||||
|
//@ts-ignore
|
||||||
|
verbose: true,
|
||||||
|
silent: false,
|
||||||
|
debug: true,
|
||||||
|
config: 'tailwind.config.js', // tailwind config file path (optional)
|
||||||
|
compile: false, // false: interpretation mode; true: compilation mode
|
||||||
|
prefix: 'windi-', // set compilation mode style prefix
|
||||||
|
globalPreflight: true, // set preflight style is global or scoped
|
||||||
|
globalUtility: true // set utility style is global or scoped
|
||||||
|
}),
|
||||||
|
svelte({
|
||||||
|
//@ts-ignore
|
||||||
|
hot: !isProduction,
|
||||||
|
emitCss: true,
|
||||||
|
extensions: [ '.md', '.svx', '.svelte' ],
|
||||||
|
preprocess: [
|
||||||
|
//
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
indexReplace()
|
||||||
|
]
|
||||||
|
};
|
||||||
|
});
|
@ -1,9 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
globDirectory: 'public',
|
|
||||||
globPatterns: [ '**/*.{js,ico,png,svg,html,webmanifest,txt,json}' ],
|
|
||||||
globIgnores: [ 'env.js', 'env.sample.js' ],
|
|
||||||
swDest: 'public/sw.js',
|
|
||||||
cleanupOutdatedCaches: true,
|
|
||||||
mode: 'production',
|
|
||||||
sourcemap: false
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user