Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
namespace aliased imports for client per #80 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdefore committed Feb 9, 2016
1 parent dc71a6f commit 33ac656
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bin/merge-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ module.exports = (userConfig) => {

// add routes, reducer and rootClientComponent aliases so that client has access to them
combinedWebpackConfig.resolve.alias = combinedWebpackConfig.resolve.alias || {};
combinedWebpackConfig.resolve.alias.routes = universalReduxConfig.routes;
combinedWebpackConfig.resolve.alias.middleware = universalReduxConfig.redux.middleware || path.resolve(__dirname, '../lib/helpers/empty.js');
combinedWebpackConfig.resolve.alias['universal-redux/routes'] = universalReduxConfig.routes;
combinedWebpackConfig.resolve.alias['universal-redux/middleware'] = universalReduxConfig.redux.middleware || path.resolve(__dirname, '../lib/helpers/empty.js');
const rootComponentPath = universalReduxConfig.rootClientComponent || universalReduxConfig.rootComponent || path.resolve(__dirname, '../lib/client/root.js');
combinedWebpackConfig.resolve.alias.rootClientComponent = rootComponentPath;
combinedWebpackConfig.resolve.alias['universal-redux/rootClientComponent'] = rootComponentPath;

// add project level vendor libs
if (universalReduxConfig.webpack.vendorLibraries && isProduction) {
Expand Down
4 changes: 2 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { render as renderDevtools } from './client/devtools';

// dependencies of external source. these resolve via webpack aliases
// as assigned in merge-configs.js
import middleware from 'middleware';
import createRootClientComponent from 'rootClientComponent';
import middleware from 'universal-redux/middleware';
import createRootClientComponent from 'universal-redux/rootClientComponent';

const dest = document.getElementById('content');

Expand Down
2 changes: 1 addition & 1 deletion src/client/providers/async-props.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Provider } from 'react-redux';
import { Router } from 'react-router';
import getRoutes from 'routes';
import getRoutes from 'universal-redux/routes';
import AsyncProps from '../../vendor/async-props';

export default function(store, devComponent) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/providers/react-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Router } from 'react-router';
import { browserHistory } from 'react-router';
import { ReduxAsyncConnect } from 'redux-async-connect';
import getRoutes from 'routes';
import getRoutes from 'universal-redux/routes';

export default function(store) {
const component = (
Expand Down

0 comments on commit 33ac656

Please sign in to comment.