Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
double loading image example sveltejs/svelte#3579
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrowe committed Sep 17, 2019
1 parent 8acabbd commit 62c0c4f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"dependencies": {
"express": "^4.17.1",
"nocache": "^2.1.0",
"svelte": "^3.6.5"
"svelte": "^3.12.1"
},
"devDependencies": {
"nodemon": "^1.19.1",
"nodemon": "^1.19.2",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"svelte-loader": "^2.13.4",
"webpack": "^4.35.3",
"webpack-cli": "^3.3.5"
"svelte-loader": "^2.13.6",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.8"
},
"scripts": {
"clean": "rm -rf dist",
Expand Down
1 change: 1 addition & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export let bottomItems;
</style>

<div id="test-inner">
<img src="/svelte-logo-horizontal.svg" alt="svelte logo">
<p><small>If you open the console you should notice that the client
loads after 1sec and there should be no visible difference.</small></p>
<div id="top" class="num-box">
Expand Down
8 changes: 8 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ server.use(
})
);

server.use(
express.static(__dirname, {
etag: false,
lastModified: false,
setHeaders: res => nocache(null, res, noop)
})
);

// all URLs goto render
server.get("*", render);

Expand Down
3 changes: 3 additions & 0 deletions src/svelte-logo-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 62c0c4f

Please sign in to comment.