Skip to content
Snippets Groups Projects
Commit ea5a2867 authored by Jure's avatar Jure
Browse files

Correct router state/props.

parent eb78ee2b
No related branches found
No related tags found
No related merge requests found
import React from 'react'
import { render } from 'react-dom'
import configureStore from './store/configureStore'
import Root from './containers/Root'
let store = configureStore()
React.render(
render(
<Root store={store} />,
document.getElementById('root')
)
import { routerStateReducer } from 'redux-router'
import { routerStateReducer as router } from 'redux-router'
import { combineReducers } from 'redux'
import * as ActionTypes from '../actions'
......@@ -49,7 +49,7 @@ function reducer (state = initialState, action) {
const rootReducer = combineReducers({
reducer,
errorMessage,
routerStateReducer
router
})
export default rootReducer
......@@ -14,7 +14,7 @@ import Create from './components/Create'
import Share from './components/Share'
export default (
<Route component={App}>
<Route path='/' component={App}>
<Route path='/' component={Share}/>
<Route path='/admin'>
<Route path='manages' component={Manage} />
......
......@@ -37,7 +37,7 @@ module.exports = [
entry: {
app: ['webpack-dev-server/client?http://' + WEBPACK_HOST + ':' + WEBPACK_PORT,
'webpack/hot/dev-server',
'./client' ]
'./index' ]
},
output: {
// The output directory as absolute path
......@@ -71,41 +71,5 @@ module.exports = [
node: {
fs: 'empty'
}
}, {
// The configuration for the server-side rendering
name: 'server-side rendering',
context: path.join(__dirname, '..', 'app'),
entry: {
app: './server',
header: './elements/Header'
},
target: 'node',
output: {
// The output directory as absolute path
path: assetsPath,
// The filename of the entry chunk as relative path inside the output.path directory
filename: '[name].server.js',
// The output path from the view of the Javascript
publicPath: publicPath,
libraryTarget: 'commonjs2'
},
devtool: 'eval-source-map',
module: {
preLoaders: [{
test: /\.js$|\.jsx$/,
exclude: /node_modules/,
loaders: ['eslint-loader']
}],
loaders: commonLoaders.concat([
{ test: /\.scss$/,
loader: 'css/locals?module&localIdentName=[local]__[hash:base64:5]' +
'&sourceMap!sass?sourceMap&outputStyle=expanded' +
'&includePaths[]=' + (path.resolve(__dirname, '../node_modules'))
}
])
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.scss']
}
}
]
var path = require("path");
var webpack = require("webpack");
var path = require('path')
var assetsPath = path.join(__dirname, "..", "public", "assets");
var publicPath = "assets/";
var assetsPath = path.join(__dirname, '..', 'public', 'assets')
var publicPath = 'assets/'
var commonLoaders = [
{
test: /\.js$|\.jsx$/,
loader: "babel-loader?stage=0",
include: path.join(__dirname, "..", "app")
loader: 'babel-loader?stage=0',
include: path.join(__dirname, '..', 'app')
},
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: "url-loader" },
{ test: /\.jpg$/, loader: "file-loader" },
{ test: /\.html$/, loader: "html-loader" },
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader' },
{ test: /\.jpg$/, loader: 'file-loader' },
{ test: /\.html$/, loader: 'html-loader' },
{ test: /\.scss$/,
loader: 'css/locals?module&localIdentName=[local]%20[hash:base64:5]' +
'&sourceMap!sass?sourceMap&outputStyle=expanded' +
'&includePaths[]=' + (path.resolve(__dirname, '../node_modules'))
}
];
]
module.exports = [
{
// The configuration for the client
name: "browser",
context: path.join(__dirname, "..", "app"),
name: 'browser',
context: path.join(__dirname, '..', 'app'),
entry: {
app: "./client"
app: './client'
},
output: {
// The output directory as absolute path
path: assetsPath,
// The filename of the entry chunk as relative path inside the output.path directory
filename: "[name].js",
filename: '[name].js',
// The output path from the view of the Javascript
publicPath: publicPath
},
devtool: "source-map",
devtool: 'source-map',
module: {
preLoaders: [{
test: /\.js$|\.jsx$/,
exclude: /node_modules/,
loaders: ["eslint"]
loaders: ['eslint']
}],
loaders: commonLoaders
},
resolve: {
extensions: ['', '.react.js', '.js', '.jsx', '.scss'],
modulesDirectories: [
"app", "node_modules"
'app', 'node_modules'
]
}
// },
......@@ -57,49 +56,8 @@ module.exports = [
// new webpack.ProvidePlugin({React: 'react'})
// ]
// // extract inline css from modules into separate files
// new ExtractTextPlugin("styles/main.css"),
// new webpack.optimize.UglifyJsPlugin()
// ]
}, {
// The configuration for the server-side rendering
name: "server-side rendering",
context: path.join(__dirname, "..", "app"),
entry: {
app: "./server",
header: "./elements/Header"
},
target: "node",
output: {
// The output directory as absolute path
path: assetsPath,
// The filename of the entry chunk as relative path inside the output.path directory
filename: "[name].server.js",
// The output path from the view of the Javascript
publicPath: publicPath,
libraryTarget: "commonjs2"
},
externals: [
{
'alt/AltContainer': true,
'react/addons': true
}
],
module: {
loaders: commonLoaders
},
resolve: {
extensions: ['', '.react.js', '.js', '.jsx', '.scss']
// modulesDirectories: [
// "app", "node_modules"
// ]
},
plugins: [
new webpack.ProvidePlugin({React: 'react'})
]
// plugins: [
// // extract inline css from modules into separate files
// new ExtractTextPlugin("styles/main.css"),
// new ExtractTextPlugin('styles/main.css'),
// new webpack.optimize.UglifyJsPlugin()
// ]
}
];
]
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment