feat(v2): separate runtimechunk (#1355)

* feat(v2): separate runtimechunk

* nits
This commit is contained in:
Endilie Yacop Sucipto 2019-04-10 19:50:37 +07:00 committed by GitHub
parent 415d2b33d1
commit f95ac033fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -86,8 +86,6 @@ module.exports = async function start(siteDir, cliOptions = {}) {
plugins: [ plugins: [
// Generates an `index.html` file with the <script> injected. // Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: false,
hash: true,
template: path.resolve( template: path.resolve(
__dirname, __dirname,
'../client/templates/index.html.template.ejs', '../client/templates/index.html.template.ejs',

View file

@ -20,6 +20,11 @@ module.exports = function createClientConfig(props) {
entry: { entry: {
main: path.resolve(__dirname, '../client/clientEntry.js'), main: path.resolve(__dirname, '../client/clientEntry.js'),
}, },
optimization: {
// Keep the runtime chunk separated to enable long term caching
// https://twitter.com/wSokra/status/969679223278505985
runtimeChunk: true,
},
plugins: [ plugins: [
// Generate manifests file // Generate manifests file
new ReactLoadableSSRAddon({ new ReactLoadableSSRAddon({