mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
Merge pull request #114 from lukeed/fix/prod-hmr
Fix: Remove HMR attempts in Prod~!
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { build, export as exporter } from 'sapper/core.js';
|
||||
import { dest, dev, entry, src } from '../config';
|
||||
import { dest, entry, isDev, src } from '../config';
|
||||
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
const cmd = process.argv[2];
|
||||
const start = Date.now();
|
||||
const dev = isDev();
|
||||
|
||||
if (cmd === 'build') {
|
||||
build({ dest, dev, entry, src })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as path from 'path';
|
||||
|
||||
export const dev = process.env.NODE_ENV !== 'production';
|
||||
export const isDev = () => process.env.NODE_ENV !== 'production';
|
||||
|
||||
export const templates = path.resolve(process.env.SAPPER_TEMPLATES || 'templates');
|
||||
export const src = path.resolve(process.env.SAPPER_ROUTES || 'routes');
|
||||
@@ -9,4 +9,4 @@ export const dest = path.resolve(process.env.SAPPER_DEST || '.sapper');
|
||||
export const entry = {
|
||||
client: path.resolve(templates, '.main.rendered.js'),
|
||||
server: path.resolve(dest, 'server-entry.js')
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,8 +5,10 @@ import rimraf from 'rimraf';
|
||||
import serialize from 'serialize-javascript';
|
||||
import escape_html from 'escape-html';
|
||||
import { create_routes, templates, create_compilers, create_assets } from 'sapper/core.js';
|
||||
import { dest, entry, isDev, src } from '../config';
|
||||
import create_watcher from './create_watcher';
|
||||
import { dest, dev, entry, src } from '../config';
|
||||
|
||||
const dev = isDev();
|
||||
|
||||
function connect_dev() {
|
||||
mkdirp.sync(dest);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { dest, dev, entry } from '../config';
|
||||
import { dest, isDev, entry } from '../config';
|
||||
|
||||
export default {
|
||||
dev,
|
||||
dev: isDev(),
|
||||
|
||||
client: {
|
||||
entry: () => {
|
||||
|
||||
Reference in New Issue
Block a user