1
0
Fork 0
mirror of synced 2024-09-28 07:11:40 +12:00

update routify to beta 40 and set up correct basepath for application, also fixes some links

This commit is contained in:
kevmodrome 2020-04-09 09:04:09 +02:00
parent 627880c69a
commit a065a4399d
6 changed files with 9 additions and 40 deletions

View file

@ -59,7 +59,7 @@
"@babel/preset-env": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@rollup/plugin-alias": "^3.0.1",
"@sveltech/routify": "1.5.0-beta.26",
"@sveltech/routify": "1.5.0-beta.40",
"babel-jest": "^24.8.0",
"browser-sync": "^2.26.7",
"http-proxy-middleware": "^0.19.1",
@ -81,4 +81,4 @@
"svelte": "^3.0.0"
},
"gitHead": "115189f72a850bfb52b65ec61d932531bf327072"
}
}

View file

@ -14,32 +14,6 @@ import replace from "rollup-plugin-replace"
import path from "path"
const target = "http://localhost:4001"
const _builderProxy = proxy("/_builder", {
target: "http://localhost:3000",
pathRewrite: { "^/_builder": "" },
})
const apiProxy = proxy(
[
"/_builder/assets/**",
"/_builder/api/**",
"/_builder/**/componentlibrary",
"/_builder/instance/**",
],
{
target,
logLevel: "debug",
changeOrigin: true,
cookieDomainRewrite: true,
onProxyReq(proxyReq) {
if (proxyReq.getHeader("origin")) {
proxyReq.setHeader("origin", target)
}
},
}
)
const production = !process.env.ROLLUP_WATCH
const lodash_fp_exports = [
@ -230,11 +204,6 @@ export default {
// Watch the `dist` directory and refresh the
// browser on changes when not in production
!production && livereload(outputpath),
!production &&
browsersync({
server: outputpath,
middleware: [apiProxy, _builderProxy],
}),
// If we're building for production (npm run build
// instead of npm run dev), minify

View file

@ -1,7 +1,7 @@
<script>
import Modal from "svelte-simple-modal"
import { onMount } from "svelte"
import { Router } from "@sveltech/routify"
import { Router, basepath } from "@sveltech/routify"
import { routes } from "@sveltech/routify/tmp/routes"
import { store, initialise } from "builderStore"
import AppNotification, {
@ -20,6 +20,8 @@
window.addEventListener("error", showErrorBanner)
window.addEventListener("unhandledrejection", showErrorBanner)
})
$basepath = "/_builder"
</script>
<AppNotification />

View file

@ -6,7 +6,7 @@
</script>
<div
on:click={() => $goto($url(href))}
on:click={() => $goto(href)}
class="budibase__nav-item backend-nav-item"
class:selected={$isActive(href)}>
{label}

View file

@ -13,7 +13,7 @@
<div>
<h4 style="margin-bottom: 20px">Choose an Application</h4>
{#each apps as app}
<a href={`/${app}`} class="app-link">{app}</a>
<a href={`./${app}`} class="app-link">{app}</a>
{/each}
</div>
</div>

View file

@ -2,7 +2,7 @@
import { store } from "builderStore"
import { fade } from "svelte/transition"
import { isActive, goto, url, context } from "@sveltech/routify"
import { isActive, goto, url, layout } from "@sveltech/routify"
import { SettingsIcon, PreviewIcon } from "components/common/Icons/"
import IconButton from "components/common/IconButton.svelte"
@ -23,8 +23,6 @@
throw new Error(pkg)
}
}
$: ({ component } = $context)
$: list = component.parent.children.filter(child => child.isIndexable)
</script>
<div class="root">
@ -38,7 +36,7 @@
</button>
<!-- List is an array of subfolders in the application folder. -->
{#each list as { path, prettyName, children, meta }}
{#each $layout.children as { path, prettyName, children, meta }}
<span
class:active={$isActive(path)}
class="topnavitem"