From 2ef9c3fe3036e3f865b1e1a0ed42eb57b6b96368 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Mon, 22 Oct 2018 20:30:47 +1100 Subject: [PATCH] Cleaned imports --- public/components/App.jsx | 2 +- public/components/Favicon.jsx | 2 +- public/components/footer/Footer.jsx | 4 ++-- public/components/header/Header.jsx | 2 +- public/components/nav/menu/HamburgerMenu.jsx | 4 ++-- public/components/nav/navbar/Navbar.jsx | 6 +++--- public/components/page/Page.jsx | 2 +- public/components/page/contact/ContactPage.jsx | 2 +- public/components/page/home/HomePage.jsx | 2 +- .../page/home/sections/BannerSection.jsx | 12 ++++++------ .../page/home/sections/ExistingWorkSection.jsx | 16 ++++++++-------- .../page/home/sections/PlatformsSection.jsx | 18 +++++++++--------- .../page/home/sections/ProgrammingSection.jsx | 12 ++++++------ .../page/home/sections/PromoVideoSection.jsx | 16 ++++++++-------- .../page/legal/privacy/PrivacyPolicyPage.jsx | 6 +++--- .../section/blog/FeaturedBlogSection.jsx | 2 +- .../components/section/image/ImageSection.jsx | 2 +- .../components/section/video/VideoSection.jsx | 4 ++-- public/objects/input/Input.jsx | 2 +- public/objects/input/form/Form.jsx | 2 +- public/objects/modal/Modal.jsx | 8 ++++---- webpack.config.js | 11 +++++++++-- 22 files changed, 72 insertions(+), 65 deletions(-) diff --git a/public/components/App.jsx b/public/components/App.jsx index 2974ac4..a5fe62f 100644 --- a/public/components/App.jsx +++ b/public/components/App.jsx @@ -25,7 +25,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { HashRouter, BrowserRouter } from 'react-router-dom'; -import Background from './../objects/background/Background'; +import Background from '@objects/background/Background'; import Header from './header/Header'; import Footer from './footer/Footer'; import Routes from './page/Routes'; diff --git a/public/components/Favicon.jsx b/public/components/Favicon.jsx index 75f3dad..7528ea9 100644 --- a/public/components/Favicon.jsx +++ b/public/components/Favicon.jsx @@ -28,7 +28,7 @@ import React from 'react'; import Helmet from 'react-helmet'; -const prefix = './../assets/images/favicon/'; +const prefix = '@assets/images/favicon/'; export default (props) => { return ( diff --git a/public/components/footer/Footer.jsx b/public/components/footer/Footer.jsx index c47378a..1a434a1 100644 --- a/public/components/footer/Footer.jsx +++ b/public/components/footer/Footer.jsx @@ -23,9 +23,9 @@ import React from 'react'; import { connect } from 'react-redux'; -import Language from './../../language/Language'; +import Language from '@public/language/Language'; import { NavLink } from 'react-router-dom' -import { PageBoundary } from './../page/Page'; +import { PageBoundary } from '@components/page/Page'; const FooterLink = function(props) { let key = "footer.links." + props.title; diff --git a/public/components/header/Header.jsx b/public/components/header/Header.jsx index c884c67..7bd3263 100644 --- a/public/components/header/Header.jsx +++ b/public/components/header/Header.jsx @@ -22,7 +22,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Navbar from './../nav/navbar/Navbar'; +import Navbar from '@components/nav/navbar/Navbar'; export default function(props) { return ( diff --git a/public/components/nav/menu/HamburgerMenu.jsx b/public/components/nav/menu/HamburgerMenu.jsx index be2d2f7..5c6b19f 100644 --- a/public/components/nav/menu/HamburgerMenu.jsx +++ b/public/components/nav/menu/HamburgerMenu.jsx @@ -24,8 +24,8 @@ import React from 'react'; import { connect } from 'react-redux'; import { NavLink } from 'react-router-dom'; -import Language from './../../../language/Language'; -import * as MenuActions from './../../../actions/MenuActions'; +import Language from '@public/language/Language'; +import * as MenuActions from '@public/actions/MenuActions'; const HamburerMenuItem = function(props) { return ( diff --git a/public/components/nav/navbar/Navbar.jsx b/public/components/nav/navbar/Navbar.jsx index 26dcfca..403109e 100644 --- a/public/components/nav/navbar/Navbar.jsx +++ b/public/components/nav/navbar/Navbar.jsx @@ -25,10 +25,10 @@ import React from 'react'; import { withRouter } from 'react-router'; import { connect } from 'react-redux'; import { NavLink } from 'react-router-dom' -import PageBoundary from './../../page/PageBoundary'; -import Language from './../../../language/Language'; +import PageBoundary from '@components/page/PageBoundary'; +import Language from '@public/language/Language'; import HamburgerMenu from './../menu/HamburgerMenu'; -import Image from './../../../objects/image/Image'; +import Image from '@objects/image/Image'; const NavbarLink = function(props) { return ( diff --git a/public/components/page/Page.jsx b/public/components/page/Page.jsx index f43ae50..dade74d 100644 --- a/public/components/page/Page.jsx +++ b/public/components/page/Page.jsx @@ -25,7 +25,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { Helmet } from "react-helmet"; import PageBoundary from './PageBoundary'; -import Language from './../../language/Language'; +import Language from '@public/language/Language'; class Page extends React.Component { constructor(props) { diff --git a/public/components/page/contact/ContactPage.jsx b/public/components/page/contact/ContactPage.jsx index dca2f42..54320f7 100644 --- a/public/components/page/contact/ContactPage.jsx +++ b/public/components/page/contact/ContactPage.jsx @@ -27,7 +27,7 @@ import { bindActionCreators } from 'redux'; //Components import Page, { PageBoundary } from './../Page'; -import Language from './../../../language/Language'; +import Language from '@public/language/Language'; //Objects import ElementScrollFader from './../../../objects/animation/fade/ElementScrollFader'; diff --git a/public/components/page/home/HomePage.jsx b/public/components/page/home/HomePage.jsx index 5346a85..9aa7961 100644 --- a/public/components/page/home/HomePage.jsx +++ b/public/components/page/home/HomePage.jsx @@ -24,7 +24,7 @@ import React from 'react'; import { connect } from 'react-redux'; import Page from './../Page'; -import Language from './../../../language/Language' +import Language from '@public/language/Language' import BannerSection from './sections/BannerSection'; import PromoVideoSection from './sections/PromoVideoSection'; diff --git a/public/components/page/home/sections/BannerSection.jsx b/public/components/page/home/sections/BannerSection.jsx index d5da7c2..27cf358 100644 --- a/public/components/page/home/sections/BannerSection.jsx +++ b/public/components/page/home/sections/BannerSection.jsx @@ -22,12 +22,12 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Language from './../../../../language/Language'; -import { PageBoundary } from './../../Page'; -import { ImageSection } from './../../../section/Section'; -import FloatingContentBox from './../../../../objects/content/FloatingContentBox'; -import { Title, Subtitle } from './../../../../objects/typography/Typography'; -import ElementScrollFader from './../../../../objects/animation/fade/ElementScrollFader'; +import Language from '@public/language/Language'; +import { PageBoundary } from '@components/page/Page'; +import { ImageSection } from '@components/section/Section'; +import FloatingContentBox from '@objects/content/FloatingContentBox'; +import { Title, Subtitle } from '@objects/typography/Typography'; +import ElementScrollFader from '@objects/animation/fade/ElementScrollFader'; export default (props) => { diff --git a/public/components/page/home/sections/ExistingWorkSection.jsx b/public/components/page/home/sections/ExistingWorkSection.jsx index 13d710b..26c5b3d 100644 --- a/public/components/page/home/sections/ExistingWorkSection.jsx +++ b/public/components/page/home/sections/ExistingWorkSection.jsx @@ -22,14 +22,14 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Language from './../../../../language/Language'; -import { PageBoundary } from './../../Page'; -import { ImageSection, SplitSection, Split, ClearSection } from './../../../section/Section'; -import ContentBox from './../../../../objects/content/ContentBox'; -import { Title, Subtitle, Paragraph, Heading1, Heading2 } from './../../../../objects/typography/Typography'; -import { Button } from './../../../../objects/input/Input'; -import ElementScrollFader from './../../../../objects/animation/fade/ElementScrollFader'; -import Image from './../../../../objects/image/Image'; +import Language from '@public/language/Language'; +import { PageBoundary } from '@components/page/Page'; +import { ImageSection, SplitSection, Split, ClearSection } from '@components/section/Section'; +import ContentBox from '@objects/content/ContentBox'; +import { Title, Subtitle, Paragraph, Heading1, Heading2 } from '@objects/typography/Typography'; +import { Button } from '@objects/input/Input'; +import ElementScrollFader from '@objects/animation/fade/ElementScrollFader'; +import Image from '@objects/image/Image'; import Window95, { TitleBar, Close, Minimize, diff --git a/public/components/page/home/sections/PlatformsSection.jsx b/public/components/page/home/sections/PlatformsSection.jsx index c3652e7..d0892ac 100644 --- a/public/components/page/home/sections/PlatformsSection.jsx +++ b/public/components/page/home/sections/PlatformsSection.jsx @@ -22,15 +22,15 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Language from './../../../../language/Language'; -import { PageBoundary } from './../../Page'; -import { ImageSection, SplitSection, Split } from './../../../section/Section'; -import FloatingContentBox from './../../../../objects/content/FloatingContentBox'; -import ContentBox from './../../../../objects/content/ContentBox'; -import Image from './../../../../objects/image/Image'; -import Video from './../../../../objects/video/Video'; -import { Title, Subtitle, Paragraph, Heading1 } from './../../../../objects/typography/Typography'; -import ElementScrollFader from './../../../../objects/animation/fade/ElementScrollFader'; +import Language from '@public/language/Language'; +import { PageBoundary } from '@components/page/Page'; +import { ImageSection, SplitSection, Split } from '@components/section/Section'; +import FloatingContentBox from '@objects/content/FloatingContentBox'; +import ContentBox from '@objects/content/ContentBox'; +import Image from '@objects/image/Image'; +import Video from '@objects/video/Video'; +import { Title, Subtitle, Paragraph, Heading1 } from '@objects/typography/Typography'; +import ElementScrollFader from '@objects/animation/fade/ElementScrollFader'; const Platform = (props) => { let children; diff --git a/public/components/page/home/sections/ProgrammingSection.jsx b/public/components/page/home/sections/ProgrammingSection.jsx index f786135..54da2e4 100644 --- a/public/components/page/home/sections/ProgrammingSection.jsx +++ b/public/components/page/home/sections/ProgrammingSection.jsx @@ -23,12 +23,12 @@ import React from 'react'; import { connect } from 'react-redux'; -import Language from './../../../../language/Language'; -import { PageBoundary } from './../../Page'; -import { ImageSection } from './../../../section/Section'; -import ContentBox from './../../../../objects/content/ContentBox'; -import { Title, Paragraph, Heading1 } from './../../../../objects/typography/Typography'; -import ElementScrollFader from './../../../../objects/animation/fade/ElementScrollFader'; +import Language from '@public/language/Language'; +import { PageBoundary } from '@components/page/Page'; +import { ImageSection } from '@components/section/Section'; +import ContentBox from '@objects/content/ContentBox'; +import { Title, Paragraph, Heading1 } from '@objects/typography/Typography'; +import ElementScrollFader from '@objects/animation/fade/ElementScrollFader'; export default (props) => { return ( diff --git a/public/components/page/home/sections/PromoVideoSection.jsx b/public/components/page/home/sections/PromoVideoSection.jsx index 4672326..8022f18 100644 --- a/public/components/page/home/sections/PromoVideoSection.jsx +++ b/public/components/page/home/sections/PromoVideoSection.jsx @@ -22,14 +22,14 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Language from './../../../../language/Language'; -import Page, { PageBoundary } from './../../Page'; -import Section, { SplitSection, Split } from './../../../section/Section'; -import FloatingContentBox from './../../../../objects/content/FloatingContentBox'; -import ContentBox from './../../../../objects/content/ContentBox'; -import Video from './../../../../objects/video/Video'; -import { Title, Subtitle, Paragraph, Heading1 } from './../../../../objects/typography/Typography'; -import ElementScrollFader from './../../../../objects/animation/fade/ElementScrollFader'; +import Language from '@public/language/Language'; +import Page, { PageBoundary } from '@components/page/Page'; +import Section, { SplitSection, Split } from '@components/section/Section'; +import FloatingContentBox from '@objects/content/FloatingContentBox'; +import ContentBox from '@objects/content/ContentBox'; +import Video from '@objects/video/Video'; +import { Title, Subtitle, Paragraph, Heading1 } from '@objects/typography/Typography'; +import ElementScrollFader from '@objects/animation/fade/ElementScrollFader'; export default (props) => { diff --git a/public/components/page/legal/privacy/PrivacyPolicyPage.jsx b/public/components/page/legal/privacy/PrivacyPolicyPage.jsx index 7140080..e485a05 100644 --- a/public/components/page/legal/privacy/PrivacyPolicyPage.jsx +++ b/public/components/page/legal/privacy/PrivacyPolicyPage.jsx @@ -23,10 +23,10 @@ import React from 'react'; import { connect } from 'react-redux'; -import Language from './../../../../language/Language'; +import Language from '@public/language/Language'; import Page, { PageBoundary } from './../../Page'; -import { BodySection, ClearSection } from './../../../section/Section'; -import { Title } from './../../../../objects/typography/Typography'; +import { BodySection, ClearSection } from '@components/section/Section'; +import { Title } from '@objects/typography/Typography'; const PrivacyPolicyPage = (props) => { return ( diff --git a/public/components/section/blog/FeaturedBlogSection.jsx b/public/components/section/blog/FeaturedBlogSection.jsx index e2d837e..57b2121 100644 --- a/public/components/section/blog/FeaturedBlogSection.jsx +++ b/public/components/section/blog/FeaturedBlogSection.jsx @@ -23,7 +23,7 @@ import React from 'react'; import Section from './../Section'; -import { PageBoundary } from './../../page/Page'; +import { PageBoundary } from '@components/page/Page'; const FeaturedArticle = function(props) { let clazz = "c-featured-blog-section__article"; diff --git a/public/components/section/image/ImageSection.jsx b/public/components/section/image/ImageSection.jsx index 3a1f4fb..62e34ea 100644 --- a/public/components/section/image/ImageSection.jsx +++ b/public/components/section/image/ImageSection.jsx @@ -23,7 +23,7 @@ import React from 'react'; import Section from './../Section'; -import Image from './../../../objects/image/Image'; +import Image from '@objects/image/Image'; export default function(props) { let image; diff --git a/public/components/section/video/VideoSection.jsx b/public/components/section/video/VideoSection.jsx index 8406d77..0d64758 100644 --- a/public/components/section/video/VideoSection.jsx +++ b/public/components/section/video/VideoSection.jsx @@ -23,8 +23,8 @@ import React from 'react'; import Section from './../Section'; -import Video from './../../../objects/video/Video'; -import Loader from './../../../objects/loading/Loader'; +import Video from '@objects/video/Video'; +import Loader from '@objects/loading/Loader'; class VideoSection extends React.Component { constructor(props) { diff --git a/public/objects/input/Input.jsx b/public/objects/input/Input.jsx index bb9266e..7da6035 100644 --- a/public/objects/input/Input.jsx +++ b/public/objects/input/Input.jsx @@ -28,7 +28,7 @@ import ButtonGroup from './button/ButtonGroup'; import Form, { FormManager } from './form/Form'; import InputGroup from './group/InputGroup'; import Label from './label/Label'; -import Keyboard from './../../keyboard/Keyboard'; +import Keyboard from '@public/keyboard/Keyboard'; export default class Input extends React.Component { constructor(props) { diff --git a/public/objects/input/form/Form.jsx b/public/objects/input/form/Form.jsx index 1e2037a..be4b389 100644 --- a/public/objects/input/form/Form.jsx +++ b/public/objects/input/form/Form.jsx @@ -22,7 +22,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; -import Loader, { LoaderBackdrop } from './../../loading/Loader'; +import Loader, { LoaderBackdrop } from '@objects/loading/Loader'; import Input, { InputGroup, TextArea } from './../Input'; export default class Form extends React.Component { diff --git a/public/objects/modal/Modal.jsx b/public/objects/modal/Modal.jsx index 82563a9..8667781 100644 --- a/public/objects/modal/Modal.jsx +++ b/public/objects/modal/Modal.jsx @@ -26,10 +26,10 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { CSSTransition, TransitionGroup } from 'react-transition-group'; import { Button } from './../input/Input'; -import Language from './../../language/Language'; -import { openModal, closeModal } from './../../actions/ModalActions'; -import { Heading4 } from './../typography/Typography'; -import Keyboard from './../../keyboard/Keyboard'; +import Language from '@public/language/Language'; +import { openModal, closeModal } from '@public/actions/ModalActions'; +import { Heading4 } from '@objects/typography/Typography'; +import Keyboard from '@public/keyboard/Keyboard'; class Modal extends React.Component { constructor(props) { diff --git a/webpack.config.js b/webpack.config.js index ccee260..5da014b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,8 @@ const webpack = require('webpack'), HtmlWebpackPlugin = require('html-webpack-plugin'), - SharpLoader = require('responsive-loader/sharp') + SharpLoader = require('responsive-loader/sharp'), + path = require('path') ; const HTMLWebpackPluginConfig = new HtmlWebpackPlugin({ @@ -26,7 +27,13 @@ module.exports = { resolve: { modules: ['node_modules', './public'], - extensions: ['.js', '.jsx', '.css', '.scss' ] + extensions: ['.js', '.jsx', '.css', '.scss' ], + alias: { + '@public': path.resolve(__dirname, './public'), + '@objects': path.resolve(__dirname, './public/objects'), + '@components': path.resolve(__dirname, './public/components'), + '@assets': path.resolve(__dirname, './public/assets') + } }, // declare loaders to be used in webpack