diff --git a/frontend/src/containers/app.js b/frontend/src/containers/app.js index 2bf3c3bd..b3cf1e06 100644 --- a/frontend/src/containers/app.js +++ b/frontend/src/containers/app.js @@ -4,7 +4,7 @@ import { Switch, Route } from 'react-router-dom'; import { injectGlobal } from 'styled-components'; import { updateRouter } from '@state/actions'; import Article from '@components/article'; -import Base from '@ui/components/base'; +import Base, { global } from '@ui/components/base'; import BaselineGrid from '@ui/components/baseline-grid'; import Footer from '@components/footer'; import Header from '@containers/header'; @@ -32,7 +32,7 @@ const App = connect()(React.createClass({ dispatch(updateRouter(router)); injectGlobal` - ${Base.global} + ${global} `; }, render: function() { diff --git a/frontend/webpack/base.js b/frontend/webpack/base.js index d6931d79..518a7924 100644 --- a/frontend/webpack/base.js +++ b/frontend/webpack/base.js @@ -45,6 +45,7 @@ module.exports = { ], module: { rules: [{ + loader: 'url-loader', exclude: [ /\.html$/, /\.(js|jsx)$/, @@ -53,7 +54,6 @@ module.exports = { /\.svg$/, /\.(eot|svg|ttf|woff|woff2)$/ ], - loader: 'url-loader', include: [ FRONTEND, UI @@ -63,16 +63,19 @@ module.exports = { } }, { test: /js?$/, + loaders: [ + 'babel-loader' + ], exclude: /node_modules/, include: [ FRONTEND, UI ], - loaders: [ - 'babel-loader' - ] }, { test: /\.svg/, + loader: [ + 'file-loader' + ], exclude: [ /node_modules/, path.join(UI, 'shared', 'fonts') @@ -80,31 +83,16 @@ module.exports = { include: [ FRONTEND, UI - ], - loader: [ - 'file-loader' ] }, { test: /\.(eot|svg|ttf|woff|woff2)$/, loader: 'file-loader', - // XXX: By commenting this out, production "BUILD=production make compile" - // will break. - // - // exclude: /node_modules/, include: [ - path.join(UI, 'shared', 'fonts') + path.join(UI, 'assets', 'fonts') ] }, { test: /\.css$/, loader: 'style-loader!css-loader' - // XXX: Commenting out breaks node_modules that use css - // i.e react-select. - - // exclude: /node_modules/, - // include: [ - // FRONTEND, - // UI - // ] }] } }; diff --git a/ui/src/components/base/index.js b/ui/src/components/base/index.js index 0731f458..46bb7a97 100644 --- a/ui/src/components/base/index.js +++ b/ui/src/components/base/index.js @@ -1,5 +1,6 @@ import { colors } from '../../shared/constants'; import styled from 'styled-components'; +import global from './global'; import { libreFranklin, @@ -16,3 +17,7 @@ export default styled.div` ${bodyColor} ${regular} `; + +export { + global +};