Skip to content

fix(server): fix dev-only imports #2124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions templates/app/server/config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ var MongoStore = connectMongo(session);<% } else if(filters.sequelize) { %>
import sqldb from '../sqldb';
import expressSequelizeSession from 'express-sequelize-session';
var Store = expressSequelizeSession(session.Store);<% } %>
import stripAnsi from 'strip-ansi';

var browserSync = require('browser-sync').create();

export default function(app) {
var env = app.get('env');
Expand Down Expand Up @@ -92,10 +89,12 @@ export default function(app) {

if ('development' === env) {
const webpackDevMiddleware = require('webpack-dev-middleware');
const stripAnsi = require('strip-ansi');
const webpack = require('webpack');
const makeWebpackConfig = require('../../webpack.make');
const webpackConfig = makeWebpackConfig({ DEV: true });
const compiler = webpack(webpackConfig);
const browserSync = require('browser-sync').create();

/**
* Run Browsersync and use middleware for Hot Module Replacement
Expand Down Expand Up @@ -128,7 +127,7 @@ export default function(app) {
if (stats.hasErrors() || stats.hasWarnings()) {
return browserSync.sockets.emit('fullscreen:message', {
title: "Webpack Error:",
body: stripAnsi(stats.toString()),
body: stripAnsi(stats.toString()),
timeout: 100000
});
}
Expand Down