⚡ improved dev scripts for speed starts
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
dccf7c6c8d
commit
383f82807f
23
index.template.html
Normal file
23
index.template.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
||||
<meta name="theme-color" content="#FFFFFF">
|
||||
<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>
|
||||
__TAILWIND_INSERT__
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.3.1-RELEASE_INFO</span>
|
||||
<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>
|
@ -3,8 +3,9 @@
|
||||
"version": "0.3.1",
|
||||
"scripts": {
|
||||
"i18n-order": "node order.js",
|
||||
"dev": "snowpack dev",
|
||||
"build": "snowpack build",
|
||||
"dev:all": "cross-env NODE_ENV_ODIT=production && node template-copy.js && snowpack dev",
|
||||
"dev:fast": "cross-env NODE_ENV_ODIT=development_fast && node template-copy.js && snowpack dev",
|
||||
"build": "cross-env NODE_ENV_ODIT=production && node template-copy.js && snowpack build",
|
||||
"build:sw": "workbox generateSW workbox-config.js",
|
||||
"release": "release-it",
|
||||
"licenses:export": "license-exporter --json -o public"
|
||||
@ -28,6 +29,7 @@
|
||||
"@snowpack/plugin-svelte": "3.5.1",
|
||||
"auto-changelog": "^2.2.1",
|
||||
"autoprefixer": "10.2.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"postcss": "8.2.4",
|
||||
"postcss-load-config": "3.0.0",
|
||||
"release-it": "^14.2.2",
|
||||
|
@ -1,22 +1 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
||||
<meta name="theme-color" content="#FFFFFF">
|
||||
<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>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.3.1-RELEASE_INFO</span>
|
||||
<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>
|
||||
<!-- this is configured with dev scripts -->
|
6
s-config.template.js
Normal file
6
s-config.template.js
Normal file
@ -0,0 +1,6 @@
|
||||
const sveltePreprocess = require('svelte-preprocess');
|
||||
const preprocess = sveltePreprocess(__insert__);
|
||||
|
||||
module.exports = {
|
||||
preprocess
|
||||
};
|
@ -1,11 +1 @@
|
||||
const sveltePreprocess = require('svelte-preprocess');
|
||||
|
||||
const preprocess = sveltePreprocess({
|
||||
postcss: {
|
||||
plugins: [ require('tailwindcss'), require('autoprefixer') ]
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
preprocess
|
||||
};
|
||||
// this is configured with dev scripts
|
||||
|
22
template-copy.js
Normal file
22
template-copy.js
Normal file
@ -0,0 +1,22 @@
|
||||
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__',
|
||||
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">'
|
||||
);
|
||||
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');
|
Loading…
x
Reference in New Issue
Block a user