Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable ssr #30

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Local Netlify folder
.netlify
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "pnpm build"
publish = "sites/demo/build"

[functions]
directory = "sites/demo/.netlify"
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sites/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.netlify/

# Output
.output
Expand Down
6 changes: 6 additions & 0 deletions sites/demo/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
command = "pnpm build"
publish = "build"

[functions]
directory = ".netlify"
1 change: 1 addition & 0 deletions sites/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@skeletonlabs/skeleton": "2.10.2",
"@skeletonlabs/tw-plugin": "0.4.0",
"@sveltejs/adapter-auto": "^3.2.4",
"@sveltejs/adapter-netlify": "^4.3.3",
"@sveltejs/kit": "^2.5.24",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tailwindcss/forms": "0.5.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StyleSpecification } from 'maplibre-gl';
import type { PageLoad } from './$types';
import type { PageServerLoad } from './$types';

export const load: PageLoad = async () => {
export const load: PageServerLoad = async () => {
const style: StyleSpecification = {
version: 8,
center: [138.76574, 35.20046],
Expand Down
2 changes: 1 addition & 1 deletion sites/demo/src/routes/(doc)/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</a>
<a
class="btn btn-sm variant-ghost-surface"
href="https://github.com/watergis/maplibre-gl-export"
href="https://github.com/watergis/maplibre-gl-sky"
target="_blank"
rel="noreferrer"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LayoutLoad } from './$types';
import type { LayoutServerLoad } from './$types';

export const load: LayoutLoad = async ({ url }) => {
export const load: LayoutServerLoad = async ({ url }) => {
const title = 'Maplibre GL Sky';
const site_name = 'Maplibre GL Sky Demo';
const site_description = 'Demo website for maplibre-gl-sky plugin';
Expand All @@ -13,6 +13,3 @@ export const load: LayoutLoad = async ({ url }) => {
socialImage
};
};

export const prerender = true;
export const ssr = false;
7 changes: 5 additions & 2 deletions sites/demo/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-netlify';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -12,7 +12,10 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
adapter: adapter({
edge: false,
split: false
})
}
};
export default config;
5 changes: 4 additions & 1 deletion sites/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [sveltekit(), purgeCss()]
plugins: [sveltekit(), purgeCss()],
ssr: {
noExternal: 'maplibre-gl'
}
});