From acf40fd1819e3e412b7a2b2a173bdeda0d47b90c Mon Sep 17 00:00:00 2001 From: MatyiFKBT Date: Tue, 18 Jun 2019 12:42:03 +0200 Subject: [PATCH 1/7] Update README.md now deployment should be from the public folder, just like surge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d1d1702..8874525 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ npm install -g now Then, from within your project folder: ```bash +cd public now ``` From 6a0e854bd0b85d7bb045c6a79d5179c70e4af76e Mon Sep 17 00:00:00 2001 From: Roman Karavia <47303530+romankaravia@users.noreply.github.com> Date: Sun, 15 Sep 2019 17:26:44 +0200 Subject: [PATCH 2/7] Fix charset UTF-8 needs to have a dash, see e.g. the example [here](https://www.w3.org/TR/html50/document-metadata.html#character-encoding-declaration). The current value of `utf8` does not work with Internet Explorer 11. I guess most other browsers will default to UTF-8 anyway when they encounter an unknown charset value. --- public/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 7f702f7..de73542 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,7 @@ - + Svelte app @@ -15,4 +15,4 @@ - \ No newline at end of file + From 4e3a4089b4f0275964eb10a432dc1c15526a0b4d Mon Sep 17 00:00:00 2001 From: Conduitry Date: Mon, 23 Sep 2019 22:52:24 -0400 Subject: [PATCH 3/7] readme: mention sirv --host --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8874525..5adce8b 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ npm run dev Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes. +By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`. + ## Deploying to the web From 66cb32c6fc81ef171ec571a71a5adc46e12c944e Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 23 Oct 2019 09:43:45 -0400 Subject: [PATCH 4/7] don't start dev server until bundle is generated (#73) * don't start dev server until bundle is generated (#72) * extract `npm run start:dev` spawn into separate file --- package.json | 4 +--- rollup.config.js | 5 +++++ rollup_start_dev.js | 12 ++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 rollup_start_dev.js diff --git a/package.json b/package.json index 48087d8..1ef0ea5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "svelte-app", "version": "1.0.0", "devDependencies": { - "npm-run-all": "^4.1.5", "rollup": "^1.12.0", "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-livereload": "^1.0.0", @@ -16,8 +15,7 @@ }, "scripts": { "build": "rollup -c", - "autobuild": "rollup -c -w", - "dev": "run-p start:dev autobuild", + "dev": "rollup -c -w", "start": "sirv public --single", "start:dev": "sirv public --single --dev" } diff --git a/rollup.config.js b/rollup.config.js index e5b94ec..04755f3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,6 +3,7 @@ import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; +import rollup_start_dev from './rollup_start_dev'; const production = !process.env.ROLLUP_WATCH; @@ -36,6 +37,10 @@ export default { }), commonjs(), + // In dev mode, call `npm run start:dev` once + // the bundle has been generated + !production && rollup_start_dev, + // Watch the `public` directory and refresh the // browser on changes when not in production !production && livereload('public'), diff --git a/rollup_start_dev.js b/rollup_start_dev.js new file mode 100644 index 0000000..228f8dc --- /dev/null +++ b/rollup_start_dev.js @@ -0,0 +1,12 @@ +import * as child_process from 'child_process'; + +let running_dev_server = false; + +export default { + writeBundle() { + if (!running_dev_server) { + running_dev_server = true; + child_process.spawn('npm', ['run', 'start:dev'], { stdio: ['ignore', 'inherit', 'inherit'] }); + } + } +}; From 724510f4f9458ee043698e2787e1773508a2182b Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 23 Oct 2019 12:19:21 -0400 Subject: [PATCH 5/7] fix spawn on Windows (#80) --- rollup_start_dev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup_start_dev.js b/rollup_start_dev.js index 228f8dc..eb2eedd 100644 --- a/rollup_start_dev.js +++ b/rollup_start_dev.js @@ -6,7 +6,7 @@ export default { writeBundle() { if (!running_dev_server) { running_dev_server = true; - child_process.spawn('npm', ['run', 'start:dev'], { stdio: ['ignore', 'inherit', 'inherit'] }); + child_process.spawn('npm', ['run', 'start:dev'], { stdio: ['ignore', 'inherit', 'inherit'], shell: true }); } } }; From f1427f41d36b2a892e1e0bc49b9739bceab21eb2 Mon Sep 17 00:00:00 2001 From: halfnelson Date: Tue, 15 Oct 2019 23:03:17 +1000 Subject: [PATCH 6/7] update rollup-plugin-terser fixes #74 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1ef0ea5..9c913cd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "rollup-plugin-livereload": "^1.0.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-svelte": "^5.0.3", - "rollup-plugin-terser": "^4.0.4", + "rollup-plugin-terser": "^5.1.2", "svelte": "^3.0.0" }, "dependencies": { From c70a595fd46bd90a68ab966f8a6b95d5b0f17909 Mon Sep 17 00:00:00 2001 From: "MD. Mehedi Hasan" Date: Fri, 1 Nov 2019 16:45:54 +0600 Subject: [PATCH 7/7] centered Hello World! --- src/App.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.svelte b/src/App.svelte index 0fbce2a..601206c 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -5,6 +5,7 @@