mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-17 05:04:55 +00:00
fix HMR attempts in production
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import { build, export as exporter } from 'sapper/core.js';
|
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';
|
process.env.NODE_ENV = 'production';
|
||||||
|
|
||||||
const cmd = process.argv[2];
|
const cmd = process.argv[2];
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
|
const dev = isDev();
|
||||||
|
|
||||||
if (cmd === 'build') {
|
if (cmd === 'build') {
|
||||||
build({ dest, dev, entry, src })
|
build({ dest, dev, entry, src })
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as path from 'path';
|
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 templates = path.resolve(process.env.SAPPER_TEMPLATES || 'templates');
|
||||||
export const src = path.resolve(process.env.SAPPER_ROUTES || 'routes');
|
export const src = path.resolve(process.env.SAPPER_ROUTES || 'routes');
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import rimraf from 'rimraf';
|
|||||||
import serialize from 'serialize-javascript';
|
import serialize from 'serialize-javascript';
|
||||||
import escape_html from 'escape-html';
|
import escape_html from 'escape-html';
|
||||||
import { create_routes, templates, create_compilers, create_assets } from 'sapper/core.js';
|
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 create_watcher from './create_watcher';
|
||||||
import { dest, dev, entry, src } from '../config';
|
|
||||||
|
const dev = isDev();
|
||||||
|
|
||||||
function connect_dev() {
|
function connect_dev() {
|
||||||
mkdirp.sync(dest);
|
mkdirp.sync(dest);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { dest, dev, entry } from '../config';
|
import { dest, isDev, entry } from '../config';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dev,
|
dev: isDev(),
|
||||||
|
|
||||||
client: {
|
client: {
|
||||||
entry: () => {
|
entry: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user