Erste kleine Anpassungen am Tibi-Svelte-Starter um später mehr Zeit in neuen Projekten zu sparen. Hier werden noch weitere Anpassungen folgen, die grundlegend in den meisten Projekten benötigt werden.

This commit is contained in:
2022-03-17 11:12:06 +01:00
parent 75a8906d4a
commit 5caa62eb7e
9 changed files with 585 additions and 26 deletions

View File

@@ -5,8 +5,7 @@ const resolvePlugin = {
// url in css does not resolve via esbuild-svelte correctly
build.onResolve({ filter: /.*/, namespace: "fakecss" }, (args) => {
// console.log(args)
if (args.path.match(/^\./))
return { path: path.dirname(args.importer) + "/" + args.path }
if (args.path.match(/^\./)) return { path: path.dirname(args.importer) + "/" + args.path }
// return { path: path.join(args.resolveDir, "public", args.path) }
})
},
@@ -54,6 +53,8 @@ const options = {
".eot": "file",
".svg": "file",
".ttf": "file",
".png": "file",
".jpg": "file",
},
sourcemap: true,
target: ["es2020", "chrome61", "firefox60", "safari11", "edge18"],
@@ -63,9 +64,7 @@ const bsMiddleware = []
if (process.argv[2] == "start") {
const { createProxyMiddleware } = require("http-proxy-middleware")
const apiBase =
process.env.API_BASE ||
"http://localhost:8080/api/v1/_/" + process.env.NAMESPACE
const apiBase = process.env.API_BASE || "http://localhost:8080/api/v1/_/" + process.env.NAMESPACE
bsMiddleware.push(
createProxyMiddleware("/api", {
target: apiBase,