Compare commits

..

6 Commits

Author SHA1 Message Date
Rich Harris
631afbbfe4 -> v0.7.4 2018-02-27 20:10:48 -05:00
Rich Harris
1cc9acb4f1 Merge pull request #142 from sveltejs/gh-141
force NODE_ENV=production in build/export
2018-02-27 20:09:05 -05:00
Rich Harris
19005110f1 huh, not sure why that changed 2018-02-27 19:58:49 -05:00
Rich Harris
21ee8ad39d force NODE_ENV=production in build/export 2018-02-27 19:49:58 -05:00
Rich Harris
906b0c7ad5 Merge pull request #134 from sveltejs/source-map-support
install source-map-support
2018-02-27 19:46:17 -05:00
Rich Harris
896fd410d1 install source-map-support 2018-02-20 14:01:25 -05:00
5 changed files with 15 additions and 3 deletions

View File

@@ -1,5 +1,10 @@
# sapper changelog
## 0.7.4
* Force `NODE_ENV='production'` when running `build` or `export` ([#141](https://github.com/sveltejs/sapper/issues/141))
* Use source-map-support ([#134](https://github.com/sveltejs/sapper/pull/134))
## 0.7.3
* Handle webpack assets that are arrays instead of strings ([#131](https://github.com/sveltejs/sapper/pull/131))

View File

@@ -1,6 +1,6 @@
{
"name": "sapper",
"version": "0.7.3",
"version": "0.7.4",
"description": "Military-grade apps, engineered by Svelte",
"main": "middleware.js",
"bin": {
@@ -37,6 +37,7 @@
"rimraf": "^2.6.2",
"sander": "^0.6.0",
"serialize-javascript": "^1.4.0",
"source-map-support": "^0.5.3",
"tslib": "^1.8.1",
"url-parse": "^1.2.0",
"wait-port": "^0.2.2",
@@ -60,7 +61,6 @@
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-string": "^2.0.2",
"rollup-plugin-typescript": "^0.8.1",
"source-map-support": "^0.5.2",
"style-loader": "^0.19.1",
"svelte": "^1.49.1",
"svelte-loader": "^2.3.2",

View File

@@ -30,6 +30,8 @@ const [cmd] = opts._;
const start = Date.now();
if (cmd === 'build') {
process.env.NODE_ENV = 'production';
build({ dest, dev: false, entry, src })
.then(() => {
const elapsed = Date.now() - start;
@@ -39,6 +41,8 @@ if (cmd === 'build') {
console.error(err ? err.details || err.stack || err.message || err : 'Unknown error');
});
} else if (cmd === 'export') {
process.env.NODE_ENV = 'production';
build({ dest, dev: false, entry, src })
.then(() => exporter(dest))
.then(() => {

View File

@@ -9,6 +9,9 @@ import escape_html from 'escape-html';
import { create_routes, templates, create_compilers, create_template } from 'sapper/core.js';
import { dest, entry, isDev, src } from '../config';
import { Route, Template } from '../interfaces';
import sourceMapSupport from 'source-map-support';
sourceMapSupport.install();
const dev = isDev();

View File

@@ -389,7 +389,7 @@ function run(env) {
);
assert.ok(
/<\/client\/[^/]+\/main\.js>;rel="preload";as="script", <\/client\/[^/]+\/_\.0\.js>;rel="preload";as="script"/.test(headers['link']),
/<\/client\/[^/]+\/main\.js>;rel="preload";as="script", <\/client\/[^/]+\/_\.\d+\.js>;rel="preload";as="script"/.test(headers['link']),
headers['link']
);
});