Skip to content

Commit dc90d95

Browse files
committed
Fix file paths in production environment configuration
1 parent fd2ac3f commit dc90d95

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

SSRtest/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Server side rendering template for React 16",
55
"main": "src/index.js",
66
"scripts": {
7-
"start": "cross-env NODE_ENV=development babel-node src/index",
7+
"start": "cross-env NODE_ENV=production babel-node src/index",
88
"watch": "cross-env NODE_ENV=development babel-watch src/index",
99
"build": "npm run build:client && npm run build:server && npm run build:node",
1010
"build:client": "cross-env NODE_ENV=production webpack -p --config webpack/client.production.js",
@@ -44,6 +44,7 @@
4444
"babel-preset-env": "^1.6.0",
4545
"babel-preset-react": "^6.24.1",
4646
"babel-preset-stage-0": "^6.24.1",
47+
"babel-register": "^6.26.0",
4748
"copy-webpack-plugin": "^4.2.1",
4849
"cross-env": "^5.0.5",
4950
"css-hot-loader": "^1.3.1",

SSRtest/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ const configureDevelopment = app => {
3737
* @param app Express app
3838
*/
3939
const configureProduction = app => {
40-
const clientStats = require('./assets/stats.json');
41-
const serverRender = require('./assets/app.server.js').default;
40+
const clientStats = require('../public/assets/stats.json');
41+
const serverRender = require('../public/assets/app.server.js').default;
4242
const publicPath = '/';
43-
const outputPath = join(__dirname, 'assets');
43+
const outputPath = join(__dirname, '../public/assets');
4444

4545
app.use(publicPath, express.static(outputPath));
4646
app.use(serverRender({
4747
clientStats,
4848
outputPath
4949
}));
5050

51-
app.set('views', join(__dirname, 'views'));
51+
app.set('views', join(__dirname, '../public/views'));
5252
};
5353

5454
const app = express();

0 commit comments

Comments
 (0)