Skip to content

Commit

Permalink
Merge pull request #32 from aickin/common-chunk
Browse files Browse the repository at this point in the history
Move common code out into a common chunk so that it can be separately cached
  • Loading branch information
gigabo committed Feb 23, 2016
2 parents c69b326 + 8c98fbb commit e30947a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-server-cli/src/compileClient.js
Expand Up @@ -84,6 +84,10 @@ const packageCodeForBrowser = (entrypoints, outputDir, outputUrl, hot, minify) =
},
plugins: [
new ExtractTextPlugin("[name].css"),
new webpack.optimize.CommonsChunkPlugin({
name:"common",
filename: "common.js",
}),
],
};

Expand Down
1 change: 1 addition & 0 deletions packages/react-server-cli/src/coreJsMiddleware.js
Expand Up @@ -4,6 +4,7 @@ export default (pathToStatic) => {
const routeName = this.getRequest().getRouteName();
const baseUrl = pathToStatic || "/";
return [
`${baseUrl}common.js`,
`${baseUrl}${routeName}.bundle.js`,
{
type: "text/javascript",
Expand Down

0 comments on commit e30947a

Please sign in to comment.