🐞 fix cross-env logic for faster dev starts ⚡
This commit is contained in:
parent
c8aeba38ba
commit
2ce41990bf
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,5 +7,5 @@ public/env.js
|
|||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
*.map
|
*.map
|
||||||
public/index.html
|
/public/index.html
|
||||||
svelte.config.js
|
/svelte.config.js
|
@ -3,9 +3,9 @@
|
|||||||
"version": "0.3.1",
|
"version": "0.3.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"i18n-order": "node order.js",
|
"i18n-order": "node order.js",
|
||||||
"dev:all": "cross-env NODE_ENV_ODIT=production && node template-copy.js && snowpack dev",
|
"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",
|
"dev:fast": "cross-env NODE_ENV_ODIT=development_fast node template-copy.js",
|
||||||
"build": "cross-env NODE_ENV_ODIT=production && node template-copy.js && snowpack build",
|
"build": "cross-env NODE_ENV_ODIT=production node template-copy.js && snowpack build",
|
||||||
"build:sw": "workbox generateSW workbox-config.js",
|
"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"
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
let content_svelteconfig = fs.readFileSync('./s-config.template.js', { encoding: 'utf8' });
|
let content_svelteconfig = fs.readFileSync('./s-config.template.js', { encoding: 'utf8' });
|
||||||
let content_html = fs.readFileSync('./index.template.html', { encoding: 'utf8' });
|
let content_html = fs.readFileSync('./index.template.html', { encoding: 'utf8' });
|
||||||
if (process.env.NODE_ENV_ODIT === 'development_fast') {
|
if (process.env.NODE_ENV_ODIT == 'development_fast') {
|
||||||
content_html = content_html.replace(
|
content_html = content_html.replace(
|
||||||
'__TAILWIND_INSERT__',
|
'__TAILWIND_INSERT__',
|
||||||
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">'
|
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">'
|
||||||
);
|
);
|
||||||
content_svelteconfig = content_svelteconfig.replace('__insert__', '{postcss:{}}');
|
content_svelteconfig = content_svelteconfig.replace('__insert__', '{postcss:{}}');
|
||||||
} else {
|
} else {
|
||||||
content_html = content_html.replace(
|
content_html = content_html.replace('__TAILWIND_INSERT__', '');
|
||||||
'__TAILWIND_INSERT__',
|
|
||||||
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.0.2/dist/tailwind.min.css">'
|
|
||||||
);
|
|
||||||
content_svelteconfig = content_svelteconfig.replace(
|
content_svelteconfig = content_svelteconfig.replace(
|
||||||
'__insert__',
|
'__insert__',
|
||||||
"{postcss:{plugins:[require('tailwindcss'),require('autoprefixer')]}}"
|
"{postcss:{plugins:[require('tailwindcss'),require('autoprefixer')]}}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user