Skip to content

Commit

Permalink
fixes production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Apr 26, 2017
1 parent 0064ae4 commit 69dc785
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions bin/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ const helmet = require("helmet");
const path = require("path");
const webpack = require("webpack");

console.log("\n\n📂 Gathering resources\n");
const appDir = process.cwd();
const resolve = require("../webpack/resolve");
const store = resolve("store.js") || {};
const headerConfig = resolve("helmet.js") || {};
const NODE_ENV = process.env.NODE_ENV || "development";
const PORT = process.env.PORT || 3300;
const ATTRS = process.env.ATTRS;
const API = process.env.API;

console.log("\n\n📂 Gathering resources\n");
const appDir = process.cwd();
const joiner = NODE_ENV === "development" ? "../" : "";
const resolve = require(path.join(__dirname, joiner, "webpack/require-fallback"));
const store = resolve("store.js") || {};
const headerConfig = resolve("helmet.js") || {};

const i18n = require("i18next");
const Backend = require("i18next-node-fs-backend");
const i18nMiddleware = require("i18next-express-middleware");
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion webpack/webpack.config.dev-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const webpack = require("webpack");
const assetsPath = path.join(appDir, "static", "assets");
const publicPath = "/assets/";
const appPath = path.join(appDir, "app");
const variables = require("./resolve")("style.js") || {};
const variables = require("./require-fallback")("style.js") || {};

const hotMiddlewareScript = "webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true";

Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const webpack = require("webpack");
const assetsPath = path.join(appDir, "static", "assets");
const publicPath = "/assets/";
const appPath = path.join(appDir, "app");
const variables = require("./resolve")("style.js") || {};
const variables = require("./require-fallback")("style.js") || {};

const ExtractTextPlugin = require("extract-text-webpack-plugin");
const InlineEnviromentVariablesPlugin = require("inline-environment-variables-webpack-plugin");
Expand Down

0 comments on commit 69dc785

Please sign in to comment.