Compare commits

...

3 Commits

Author SHA1 Message Date
Rich Harris
278be67228 -> v0.22.2 2018-09-30 22:06:19 -04:00
Rich Harris
64921dfc3c make directories relative to project 2018-09-30 22:05:55 -04:00
Rich Harris
c8962ccf8c update gitignore 2018-09-30 21:12:46 -04:00
4 changed files with 12 additions and 4 deletions

3
.gitignore vendored
View File

@@ -11,4 +11,5 @@ test/app/build
sapper
runtime.js
dist
!rollup.config.js
!rollup.config.js
templates/*.js

View File

@@ -1,5 +1,9 @@
# sapper changelog
## 0.22.2
* Make paths in generated code relative to project
## 0.22.1
* Fix `pkg.files`

View File

@@ -1,6 +1,6 @@
{
"name": "sapper",
"version": "0.22.1",
"version": "0.22.2",
"description": "Military-grade apps, engineered by Svelte",
"bin": {
"sapper": "./sapper"

View File

@@ -204,9 +204,12 @@ function generate_server(
error
};`.replace(/^\t\t/gm, '').trim();
const build_dir = path.relative(process.cwd(), locations.dest());
const src_dir = path.relative(process.cwd(), locations.src());
return `// This file is generated by Sapper — do not edit it!\n` + template
.replace('__BUILD__DIR__', JSON.stringify(locations.dest()))
.replace('__SRC__DIR__', JSON.stringify(locations.src()))
.replace('__BUILD__DIR__', JSON.stringify(build_dir))
.replace('__SRC__DIR__', JSON.stringify(src_dir))
.replace('__DEV__', dev() ? 'true' : 'false')
.replace(/const manifest = __MANIFEST__;/, code);
}