Skip to content

Commit

Permalink
Fix chunk links in with-react-loadable example (#550)
Browse files Browse the repository at this point in the history
Fix incorrect link to chunk scripts caused by string concatenation instead of incrementing the port number value.

`process.env.*` values are strings, so in the example file port value was `'30001'` instead of `3001`.
  • Loading branch information
fix-fix authored and jaredpalmer committed Mar 23, 2018
1 parent 1d3b9b3 commit f490b1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/with-react-loadable/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ server
: `<script src="${assets.client.js}" crossorigin></script>`}
${chunks.map(chunk => (process.env.NODE_ENV === 'production'
? `<script src="/${chunk.file}"></script>`
: `<script src="http://${process.env.HOST}:${process.env.PORT + 1}/${chunk.file}"></script>`
: `<script src="http://${process.env.HOST}:${parseInt(process.env.PORT, 10) + 1}/${chunk.file}"></script>`
)).join('\n')}
<script>window.main();</script>
</body>
Expand Down

0 comments on commit f490b1f

Please sign in to comment.