pass through mapbox setup code

pull/2336/head
Richard Harris 6 years ago
parent 17322c2e4f
commit a72d7a72f5

@ -291,6 +291,7 @@ export default app;` });
font-size: 1.6rem;
opacity: 0.7;
outline: none;
flex: 1;
}
input:focus {

@ -111,6 +111,9 @@
`https://unpkg.com/svelte@${version}`;
const rollupUrl = `https://unpkg.com/rollup@1/dist/rollup.browser.js`;
// needed for context API example
const mapbox_setup = `window.MAPBOX_ACCESS_TOKEN = process.env.MAPBOX_ACCESS_TOKEN;`;
</script>
<style>
@ -171,6 +174,12 @@
/>
{#if process.browser}
<Repl bind:this={repl} {svelteUrl} {rollupUrl} {relaxed}/>
<Repl
bind:this={repl}
{svelteUrl}
{rollupUrl}
{relaxed}
setup={mapbox_setup}
/>
{/if}
</div>

@ -97,6 +97,9 @@
const svelteUrl = `https://unpkg.com/svelte@beta`;
const rollupUrl = `https://unpkg.com/rollup@1/dist/rollup.browser.js`;
// needed for context API tutorial
const mapbox_setup = `window.MAPBOX_ACCESS_TOKEN = process.env.MAPBOX_ACCESS_TOKEN;`;
</script>
<style>
@ -242,6 +245,14 @@
</div>
<div class="tutorial-repl">
<Repl bind:this={repl} {svelteUrl} {rollupUrl} orientation="rows" on:change={handle_change} relaxed/>
<Repl
bind:this={repl}
{svelteUrl}
{rollupUrl}
orientation="rows"
on:change={handle_change}
setup={mapbox_setup}
relaxed
/>
</div>
</div>

Loading…
Cancel
Save