-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
27 lines (24 loc) · 1.05 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
process.env.BABEL_ENV = 'development';
require('babel-register')({
cache: false
});
var WebpackIsomorphicTools = require('webpack-isomorphic-tools');
// this must be equal to your Webpack configuration "context" parameter
var projectBasePath = require('path').resolve(__dirname, '.');
// this global variable will be used later in express middleware
global.webpackIsomorphicTools = new WebpackIsomorphicTools(
require('./config/webpack-isomorphic-tools-configuration')
)
// initializes a server-side instance of webpack-isomorphic-tools
// (the first parameter is the base path for your project
// and is equal to the "context" parameter of you Webpack configuration)
// (if you prefer Promises over callbacks
// you can omit the callback parameter
// and then it will return a Promise instead)
.server(projectBasePath, function() {
// webpack-isomorphic-tools is all set now.
// here goes all your web application code:
// (it must reside in a separate *.js file
// in order for the whole thing to work)
require('./server');
});