This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebPack from 'webpack'; | |
import path from 'path'; | |
import fs from 'fs'; | |
import utils from '../utils'; | |
import {StringDecoder} from 'string_decoder'; | |
import webpackDevMiddleware from 'webpack-dev-middleware'; | |
import HotReload from 'webpack-hot-middleware'; | |
let webpackConfig = require( | |
`${__dirname}/../../webpack/webpack.${utils.env.isProduction ? 'prod' : 'dev'}.js` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import env from './environment'; | |
export default { | |
env | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const env = process.env.NODE_ENV || 'DEVELOPMENT'; | |
// set env variable | |
const hasSSREnabled = (process.env.SSR || process.argv[2] === 'ssr') || false; | |
export default { | |
name: env, | |
isProduction: env === 'PRODUCTION', | |
isDevelopment: env === 'DEVELOPMENT', | |
ssrEnabled: hasSSREnabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Created by mobinni on 07/12/15. | |
*/ | |
require("babel/register")({ | |
ignore: /node_modules/ | |
}); | |
// Browser variable declaration should be ignored by server | |
delete process.env.BROWSER; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
class Item extends Component { | |
constructor(props, context) { | |
super(props, context); | |
} | |
render() { | |
const {params} = this.props; | |
return ( | |
<div>Item: {params.item}</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by mobinni on 08/12/15. | |
*/ | |
import React, {Component} from 'react'; | |
import {Link} from 'react-router'; | |
if(process.env.BROWSER) { | |
require( '../../../../styles/components/feed.scss'); | |
} | |
class Feed extends Component { | |
constructor(props, context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Feed from './components/Feed'; | |
import Item from './components/Item'; | |
export default { | |
index: { | |
path: 'feed', | |
getComponent(location, cb) { | |
cb(null, Feed); | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Components | |
import App from '../components/Main'; | |
import feed from './feed'; | |
export default { | |
path: '/', | |
component: App, | |
childRoutes: [ | |
feed.index, | |
feed.item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link href="styles.css" rel="stylesheet" type="text/css"/> | |
</head> | |
<body> | |
<div id="root"><%- reactOutput %></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your main stylesheet | |
import '../styles/general/styles.scss'; | |
// Modules | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import createBrowserHistory from 'history/lib/createBrowserHistory' | |
import Router from 'react-router'; | |
import routes from './routes'; |