This commit is contained in:
Rich Harris
2018-01-21 14:41:11 -05:00
parent 7d721abb2a
commit dd8deb2d8a
24 changed files with 166 additions and 128 deletions

View File

@@ -1,13 +1,5 @@
import * as path from 'path';
import * as assert from 'assert';
// import express from 'express';
// import Nightmare from 'nightmare';
// import serve from 'serve-static';
// import walkSync from 'walk-sync';
// import fetch from 'node-fetch';
// TODO reintegrate these as imports
const path = require('path');
const assert = require('assert');
const Nightmare = require('nightmare');
const express = require('express');
const serve = require('serve-static');
@@ -94,8 +86,10 @@ function run(env) {
}
return exec_promise.then(() => {
const resolved = require.resolve('../..');
const resolved = require.resolve('../../middleware.js');
delete require.cache[resolved];
delete require.cache[require.resolve('../../core.js')]; // TODO remove this
sapper = require(resolved);
return require('get-port')();