Compare commits

...

2 Commits

Author SHA1 Message Date
Rich Harris
9a936669c6 -> v0.2.9 2017-12-23 15:01:49 -05:00
Rich Harris
0226bd90c6 dont write service-worker.js and index.html to disk in prod mode 2017-12-23 15:01:29 -05:00
3 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
# sapper changelog # sapper changelog
## 0.2.9
* Don't write files to disk in prod mode
## 0.2.8 ## 0.2.8
* Add `goto` function ([#29](https://github.com/sveltejs/sapper/issues/29)) * Add `goto` function ([#29](https://github.com/sveltejs/sapper/issues/29))

View File

@@ -3,7 +3,7 @@ const path = require('path');
const glob = require('glob'); const glob = require('glob');
const templates = require('../templates.js'); const templates = require('../templates.js');
const route_manager = require('../route_manager.js'); const route_manager = require('../route_manager.js');
const { dest } = require('../config.js'); const { dest, dev } = require('../config.js');
function ensure_array(thing) { function ensure_array(thing) {
return Array.isArray(thing) ? thing : [thing]; // omg webpack what the HELL are you doing return Array.isArray(thing) ? thing : [thing]; // omg webpack what the HELL are you doing
@@ -17,8 +17,10 @@ module.exports = function generate_asset_cache(clientInfo, serverInfo) {
const service_worker = generate_service_worker(chunk_files); const service_worker = generate_service_worker(chunk_files);
const index = generate_index(main_file); const index = generate_index(main_file);
fs.writeFileSync(path.join(dest, 'service-worker.js'), service_worker); if (dev) {
fs.writeFileSync(path.join(dest, 'index.html'), index); fs.writeFileSync(path.join(dest, 'service-worker.js'), service_worker);
fs.writeFileSync(path.join(dest, 'index.html'), index);
}
return { return {
client: { client: {

View File

@@ -1,6 +1,6 @@
{ {
"name": "sapper", "name": "sapper",
"version": "0.2.8", "version": "0.2.9",
"description": "Military-grade apps, engineered by Svelte", "description": "Military-grade apps, engineered by Svelte",
"main": "lib/index.js", "main": "lib/index.js",
"bin": { "bin": {