Skip to content

Commit

Permalink
feat: Update the server build to bootstrap to the correct packages fr…
Browse files Browse the repository at this point in the history
…om manifest
  • Loading branch information
RyanCCollins committed Nov 12, 2016
1 parent c0b9bd5 commit 53d1ef4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion config/webpack/webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
libraryTarget: 'commonjs2',
},
resolve: {
extensions: ['', '.js', '.jsx'],
extensions: ['', '.js', '.jsx', '.json'],
alias: {
components: path.resolve(ROOT_PATH, 'app/src/components'),
containers: path.resolve(ROOT_PATH, 'app/src/containers'),
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
],
"plugins": [
"babel-plugin-webpack-alias"
],
"env": {
"test": {
"plugins": [
[
"babel-plugin-webpack-loaders", {
"config": "./config/testing/webpack.test.config.js",
"verbose": false
}
],
["transform-es2015-modules-commonjs"]
]
}
]
},
"env": {
"test": {
"plugins": [
[
"babel-plugin-webpack-loaders", {
"config": "./config/testing/webpack.test.config.js",
"verbose": false
}
],
["transform-es2015-modules-commonjs"]
]
}
},
"jest": {
Expand Down
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
require('babel-core/register');
require('./config/webpack/ignoreAssets');
var app = require('./server/app');
6 changes: 3 additions & 3 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ app.use((req, res) => {
const html = (
<Html
content={content}
scriptHash={manifest["main.js"]}
vendorHash={manifest["vendor.js"]}
cssHash={manifest["main.css"]}
scriptHash={manifest["/main.js"]}
vendorHash={manifest["/vendor.js"]}
cssHash={manifest["/main.css"]}
state={{ data: context.store.getState().apollo.data }}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions server/utils/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ function Html({ content, state, scriptHash, vendorHash, cssHash }) {
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Scalable React Boilerplate</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,700|Raleway:400,300,700|Lato:400,300,700" rel="stylesheet" type="text/css" />
<link href={`/main.${cssHash}.css`} rel="stylesheet" />
<link href={`${cssHash}`} rel="stylesheet" />
</head>
<body>
<div id="app" dangerouslySetInnerHTML={{ __html: content }} />
<script src={`/main.${scriptHash}.js`} charSet="UTF-8" />
<script src={`/vendor.${vendorHash}.js`} type="text/javascript" />
<script src={`${scriptHash}`} charSet="UTF-8" />
<script src={`${vendorHash}`} type="text/javascript" />
<script
dangerouslySetInnerHTML={{ __html: `window.__APOLLO_STATE__=${JSON.stringify(state)};` }}
charSet="UTF-8"
Expand Down

0 comments on commit 53d1ef4

Please sign in to comment.