Last active
September 11, 2017 06:54
-
-
Save whilelucky/bc4a63c13173a1908c764c67e1fb8df2 to your computer and use it in GitHub Desktop.
vendor-and-manifest-splitting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add the webpackManifest and vendor script files to your html | |
<body> | |
<div id="root">${app}</div> | |
<script>window.__INITIAL_STATE__ = ${JSON.stringify(initialState)}</script> | |
<script src="${assets.webpackManifest.js}"></script> | |
<script src="${assets.vendor.js}"></script> | |
<script src="${assets.main.js}"></script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'redux-pack'; | |
import 'redux-segment'; | |
import 'redux-thunk'; | |
import 'redux'; | |
// import other external dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entry: { | |
main: './client/index.js', | |
vendor: './client/vendor.js', | |
}, | |
new webpack.optimize.CommonsChunkPlugin({ | |
names: ['vendor', 'webpackManifest'], | |
minChunks: Infinity, | |
}), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment