-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
22 lines (17 loc) · 798 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* @flow */
/* eslint-disable */
// Allows you to use the full set of ES6 features on server-side (place it before anything else)
require('babel-polyfill');
// Allows you to precompile ES6 syntax
require('babel-register');
const WebpackIsomorphicTools = require('webpack-isomorphic-tools');
// Setup global variables for server
global.__CLIENT__ = false;
global.__SERVER__ = true;
global.__DISABLE_SSR__ = false; // Disable server side render here
global.__DEV__ = process.env.NODE_ENV !== 'production';
// This should be the same with webpack context
const dirRoot = require('path').join(process.cwd());
// Settings of webpack-isomorphic-tools
global.webpackIsomorphicTools =
new WebpackIsomorphicTools(require('./tools/webpack/WIT.config')).server(dirRoot, () => require('./src/server'));