Skip to content
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

Only require devDependencies when NODE_ENV is not production #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"babel-cli": "^6.4.0",
"babel-core": "^6.22.1",
"react": "^0.14.3",
"react-dom": "^0.14.3"
"react-dom": "^0.14.3",
"express": "^4.13.3"
},
"devDependencies": {
"autoprefixer": "^6.0.3",
Expand All @@ -45,7 +46,6 @@
"css-loader": "^0.19.0",
"eslint": "^1.5.0",
"eslint-plugin-react": "^3.4.2",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^0.8.2",
"html-webpack-plugin": "^1.6.1",
"jscs": "^2.1.1",
Expand Down
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

const path = require('path');
const express = require('express');
const webpack = require('webpack');
const webpackMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config.js');

const isDeveloping = process.env.NODE_ENV !== 'production';
const port = isDeveloping ? 3000 : process.env.PORT;
const app = express();

if (isDeveloping) {
const webpack = require('webpack');
const webpackMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config.js');
const compiler = webpack(config);
const middleware = webpackMiddleware(compiler, {
publicPath: config.output.publicPath,
Expand Down