|
|
|
@ -1,6 +1,7 @@
|
|
|
|
// @ts-check
|
|
|
|
// @ts-check
|
|
|
|
import adapter from '@sveltejs/adapter-vercel';
|
|
|
|
import adapter from '@sveltejs/adapter-vercel';
|
|
|
|
import { get_examples_data, get_examples_list } from './src/lib/server/examples/get-examples.js';
|
|
|
|
import { get_examples_data, get_examples_list } from './src/lib/server/examples/get-examples.js';
|
|
|
|
|
|
|
|
import { get_tutorial_data, get_tutorial_list } from './src/lib/server/tutorial/get-tutorial.js';
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
@ -9,7 +10,7 @@ export default {
|
|
|
|
prerender: {
|
|
|
|
prerender: {
|
|
|
|
// TODO: REMOVE
|
|
|
|
// TODO: REMOVE
|
|
|
|
handleMissingId: 'ignore',
|
|
|
|
handleMissingId: 'ignore',
|
|
|
|
entries: ['*', ...replJsonEntries()],
|
|
|
|
entries: ['*', ...replJsonEntries(), ...tutorialEntries()],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -21,3 +22,11 @@ function replJsonEntries() {
|
|
|
|
get_examples_data(new URL('../../site/content/examples', import.meta.url).pathname)
|
|
|
|
get_examples_data(new URL('../../site/content/examples', import.meta.url).pathname)
|
|
|
|
).flatMap(({ examples }) => examples.map(({ slug }) => `/repl/${slug}.json`));
|
|
|
|
).flatMap(({ examples }) => examples.map(({ slug }) => `/repl/${slug}.json`));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @returns {('*' | `/${string}`)[]} */
|
|
|
|
|
|
|
|
function tutorialEntries() {
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
return get_tutorial_list(
|
|
|
|
|
|
|
|
get_tutorial_data(new URL('../../site/content/tutorial', import.meta.url).pathname)
|
|
|
|
|
|
|
|
).flatMap(({ tutorials }) => tutorials.map(({ slug }) => `/tutorial/${slug}`));
|
|
|
|
|
|
|
|
}
|
|
|
|
|