I am creating a reactjs app and everything works fine on localhost. Things gets really problematic when I deployed the app to the hosting service.
I Have a ./reducers folder in my project which contains all of my reducers.
the project structure is this:
- App
- ---reducers
- ---store.js
now the problem is that webpack is unable to solve the import reducers from './reducers' on my store.js
here is my full store.code:
import {applyMiddleware, createStore} from 'redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';
import promise from 'redux-promise-middleware';
import reducer from './reducers';
const middleware = applyMiddleware(promise(), thunk, logger())
export default createStore(reducer, middleware)
and here is my webpack config:
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './main.js',
output:{
path: __dirname,
filename: 'index.js',
publicPath: '/'
},
devServer:{
inline: true,
port: 1515,
historyApiFallback: true
},
module:{
loaders:[
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query:{
presets: ['react', 'es2015'],
plugins: ['react-html-attrs', 'transform-object-rest-spread']
}
}
]
}
}
and here's the error from my hosting server:
I'm really sorry for the ultra long post, I've been googling around and haven't found an answer that i can understand..deploying reactjs app and webpack is something new for me
