Skip to content

Commit

Permalink
add babel path resolver for components, pages, ducks
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienLee committed Nov 25, 2017
1 parent 8ed5798 commit e11d691
Show file tree
Hide file tree
Showing 21 changed files with 715 additions and 30 deletions.
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
"regExp": ".*/components/(.+)",
"name": "/static/[1]?[sha512:hash:base64:7]"
}
],
[
"module-resolver",
{
"root": ["./"],
"alias": {
"components": "./components",
"pages": "./pages",
"ducks": "./ducks"
}
}
]
]
}
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!constants/*
!components/*
!pages/*
!redux/*
!ducks/*
!util/*
!static/*
!.babelrc
Expand Down
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ module.exports = {
jest: true,
node: true,
},
settings: {
'import/resolver': {
'babel-module': {}
}
}
};
4 changes: 2 additions & 2 deletions components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Provider } from 'react-redux';
import Router from 'next/router';
import { fromJS } from 'immutable';
import { setLogin } from '../../util/gql';
import configure from '../../redux';
import { showDialog, load } from '../../redux/auth';
import configure from 'ducks';
import { showDialog, load } from 'ducks/auth';
import AppHeader from './AppHeader';
import AppFooter from './AppFooter';
import LoginModal from '../Modal/LoginModal';
Expand Down
2 changes: 1 addition & 1 deletion components/App/AppHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import { EDITOR_FACEBOOK_GROUP, PROJECT_HACKFOLDR } from '../../constants/urls';
import { Link } from '../../routes';
import { showDialog, logout } from '../../redux/auth';
import { showDialog, logout } from 'ducks/auth';

function AppHeader({ user, onLoginClick, onLogoutClick }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/Modal/LoginModal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import Modal from './';
import { hideDialog } from '../../redux/auth';
import { hideDialog } from 'ducks/auth';
const { API_URL } = require('../../config');

function LoginModal({ isDialogShown, onModalClose }) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e11d691

Please sign in to comment.