diff --git a/package.json b/package.json index 470bd76aa..bae1a4664 100644 --- a/package.json +++ b/package.json @@ -140,6 +140,7 @@ "strip-loader": "0.1.2", "style-loader": "0.13.1", "superagent": "3.3.1", + "sw-precache-webpack-plugin": "0.11.3", "url": "0.11.0", "url-loader": "0.5.7", "webpack": "^2.5.1", diff --git a/src/client.js b/src/client.js index cd3add36d..61cec4b82 100644 --- a/src/client.js +++ b/src/client.js @@ -19,6 +19,8 @@ import createStore from './redux/create'; import routes from './routes'; import Root from './containers/Root'; +import registerServiceWorker from './registerServiceWorker'; + const client = new ApiClient(); const store = createStore(browserHistory, client, window.reduxData); const history = syncHistoryWithStore(browserHistory, store); @@ -49,13 +51,12 @@ match( const component = ( ( + render={props => - )} + />} /> ); @@ -87,3 +88,5 @@ match( } } ); + +registerServiceWorker(); diff --git a/src/helpers/Html.js b/src/helpers/Html.js index 364b07529..5e5339dc6 100644 --- a/src/helpers/Html.js +++ b/src/helpers/Html.js @@ -17,14 +17,16 @@ const Html = ({ store, component, assets }) => { {head.script.toComponent()} {head.style.toComponent()} - {Object.keys(assets.styles).map((style, i) => ( + + + {Object.keys(assets.styles).map((style, i) => - ))} + )} {Object.keys(assets.styles).length === 0 ?