Skip to content

Commit 5ae3475

Browse files
authored
Bundle locally (#2889)
* bundle locally * update bundler worker * gitignore workers * use better eliza package
2 parents 673a3c9 + 404220a commit 5ae3475

File tree

11 files changed

+21
-13
lines changed

11 files changed

+21
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ _actual*.*
2929
/site/.sessions
3030
/site/static/svelte-app.json
3131
/site/static/contributors.jpg
32+
/site/static/workers
3233
/site/scripts/svelte-app
3334
/site/src/routes/_contributors.js

site/content/examples/06-lifecycle/02-update/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import Eliza from 'elizanode';
2+
import Eliza from 'elizabot';
33
import { beforeUpdate, afterUpdate } from 'svelte';
44
55
let div;

site/content/tutorial/07-lifecycle/03-update/app-a/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import Eliza from 'elizanode';
2+
import Eliza from 'elizabot';
33
import { beforeUpdate, afterUpdate } from 'svelte';
44
55
let div;

site/content/tutorial/07-lifecycle/03-update/app-b/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import Eliza from 'elizanode';
2+
import Eliza from 'elizabot';
33
import { beforeUpdate, afterUpdate } from 'svelte';
44
55
let div;

site/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"version": "1.0.0",
44
"description": "Docs and examples for Svelte",
55
"scripts": {
6-
"dev": "sapper dev",
6+
"dev": "npm run copy-workers && sapper dev",
7+
"copy-workers": "rm -rf static/workers && cp -r node_modules/@sveltejs/svelte-repl/workers static",
78
"migrate": "node-pg-migrate -r dotenv/config",
8-
"sapper": "sapper build --legacy",
9+
"sapper": "npm run copy-workers && sapper build --legacy",
910
"update_shimport": "cp node_modules/shimport/index.js __sapper__/build/client/[email protected]",
1011
"update": "node scripts/update_template.js && node scripts/get-contributors.js",
1112
"start": "node __sapper__/build",
@@ -38,7 +39,7 @@
3839
"@babel/runtime": "^7.4.4",
3940
"@sindresorhus/slugify": "^0.9.1",
4041
"@sveltejs/site-kit": "^1.0.4",
41-
"@sveltejs/svelte-repl": "0.0.11",
42+
"@sveltejs/svelte-repl": "^0.1.0",
4243
"degit": "^2.1.3",
4344
"dotenv": "^8.0.0",
4445
"eslint-plugin-svelte3": "^1.0.0",

site/src/components/Repl/ReplWidget.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
{#if process.browser}
117117
<Repl
118118
bind:this={repl}
119+
workersUrl="workers"
119120
fixed={mobile}
120121
{svelteUrl}
121122
{rollupUrl}

site/src/routes/examples/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
<div class="repl-container" class:loading={isLoading}>
103103
<Repl
104104
bind:this={repl}
105+
workersUrl="workers"
105106
{svelteUrl}
106107
{rollupUrl}
107108
orientation={replOrientation}

site/src/routes/repl/[id]/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
<div class="viewport" class:offset={checked}>
207207
<Repl
208208
bind:this={repl}
209+
workersUrl="workers"
209210
{svelteUrl}
210211
{rollupUrl}
211212
{relaxed}

site/src/routes/tutorial/[slug]/index.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
<div class="tutorial-repl">
303303
<Repl
304304
bind:this={repl}
305+
workersUrl="workers"
305306
{svelteUrl}
306307
{rollupUrl}
307308
orientation={mobile ? 'columns' : 'rows'}

site/src/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import sirv from 'sirv';
22
import * as sapper from '@sapper/server';
33
import { API } from './backend/auth';
44

5-
const { PORT=3000 } = process.env;
5+
const { PORT = 3000 } = process.env;
66

77
API()
88
.use(
99
sirv('static', {
10+
dev: process.env.NODE_ENV === 'development',
1011
setHeaders(res) {
1112
res.setHeader('Access-Control-Allow-Origin', '*');
1213
res.hasHeader('Cache-Control') || res.setHeader('Cache-Control', 'max-age=600'); // 10min default

0 commit comments

Comments
 (0)