Skip to content

Commit

Permalink
Split client and server code into separate client/ and server/ direct…
Browse files Browse the repository at this point in the history
…ories respectively.
  • Loading branch information
MatthewWid committed Jul 17, 2019
1 parent a1445d8 commit 82d0bc1
Show file tree
Hide file tree
Showing 68 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public/**/*.js
public/**/*.css
public/**/*.css.map

src/webpack-manifest.json
src/server/webpack-manifest.json

/*.txt
mongod.sh
6 changes: 3 additions & 3 deletions config/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const FixStyleOnlyEntirePlugin = require("webpack-fix-style-only-entries");
const FILENAME = process.env.NODE_ENV === "development" ? "[name]" : "[name].[contenthash]";
const PUBDIR = path.resolve(__dirname, "..", "./public/");
const SRCDIR = path.resolve(__dirname, "..", "./src/");
const SRCDIR_JS = path.join(SRCDIR, "./js/");
const SRCDIR_SCSS = path.join(SRCDIR, "./scss/");
const SRCDIR_JS = path.join(SRCDIR, "./client/js/");
const SRCDIR_SCSS = path.join(SRCDIR, "./client/scss/");

const config = {
entry: {
Expand Down Expand Up @@ -49,7 +49,7 @@ const config = {
},
plugins: [
new ManifestPlugin({
fileName: path.join(SRCDIR, "./webpack-manifest.json")
fileName: path.join(SRCDIR, "./server/webpack-manifest.json")
}),
new FixStyleOnlyEntirePlugin({
silent: true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"license": "MIT",
"scripts": {
"server": "node ./src/server.js",
"server:watch": "nodemon --config nodemon.json ./src/server.js",
"server": "node ./src/server/server.js",
"server:watch": "nodemon --config nodemon.json ./src/server/server.js",
"build": "webpack",
"build:watch": "webpack --watch",
"start": "npm-run-all --sequential build server",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/server.js → src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");

// Environment Variables
require("dotenv").config({
path: path.resolve(__dirname, "..", "./variables.env")
path: path.resolve(__dirname, "../../", "./variables.env")
});

// Imports
Expand All @@ -19,7 +19,7 @@ const errorHandler = require("./middlewares/errorHandler.js");
const app = express();

// Constants
const PUBDIR = path.resolve(__dirname, "..", "./public/");
const PUBDIR = path.resolve(__dirname, "../../", "./public/");

// Database
mongoose.set("useCreateIndex", true);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 82d0bc1

Please sign in to comment.