I had trouble getting it to run correctly, so I did a number of things to make it work better:
combine the 4 separate webpack config files into one, which can be passed settings for client/server and development/production
remove deprecated babel "stage" presets and configure babel directly from the webpack config so that it does not transpile ES6 modules to commonJS. Benefits include simpler HMR (imported identifiers automatically point to the updated exports), errors (as in, compile time errors) when you import something from an ES6 module that is not exported, and slightly smaller bundle size due to tree shaking.
Source maps work on the server side, so all errors display a readable stack trace. This is due to the user of source-map-support and the sourceMap option to UglifyJsPlugin
Move server/index.js and server/configureStore.js inside src. I think this makes more sense since they serve a similar purpose to the existing browser versions, and are compiled by webpack. Webpack is configured to try resolving with the extensions .browser.js or .server.js depending on the environment.
Apply babel to both the development and production node servers (the non webpack compiled part), and put them in separate files.
Use the newer API for react-hot-loader: wrapping components in hot(module)() instead of using the <AppContainer /> component
Use webpack-node-externals to more accurately identify externalizable modules, also add some missing items from the whitelist.
Install rudy from ../../ in package.json instead of using an alias in webpack. Also rename the root package from redux-first-router to rudy
Downgrade eslint-config-react and eslint-config-airbnb to solve mysterious eslint crashes
Minor fixes to comply with eslint rules
Use eslint-loader in the webpack configuration. Allow warnings in development, but fail the build on warnings in production.
Add config for VSCode to ignore node_modules and such things
I had trouble getting it to run correctly, so I did a number of things to make it work better:
source-map-support
and thesourceMap
option toUglifyJsPlugin
server/index.js
andserver/configureStore.js
insidesrc
. I think this makes more sense since they serve a similar purpose to the existing browser versions, and are compiled by webpack. Webpack is configured to try resolving with the extensions.browser.js
or.server.js
depending on the environment.react-hot-loader
: wrapping components inhot(module)()
instead of using the<AppContainer />
componentwebpack-node-externals
to more accurately identify externalizable modules, also add some missing items from the whitelist.rudy
from../../
inpackage.json
instead of using an alias in webpack. Also rename the root package fromredux-first-router
torudy
eslint-config-react
andeslint-config-airbnb
to solve mysterious eslint crasheseslint-loader
in the webpack configuration. Allow warnings in development, but fail the build on warnings in production.