Skip to content

Commit

Permalink
Restore using ChunkManifestPlugin
Browse files Browse the repository at this point in the history
Removed this as previously was worried that this was part of why
redeploying with service workers was causing troubles. But as it turned
out, that was caused by not using recordPath (see #533) so this should
be safe to reenable.
  • Loading branch information
KyleAMathews committed Nov 1, 2016
1 parent f25522d commit 8d16905
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
23 changes: 12 additions & 11 deletions lib/utils/static-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ module.exports = (locals, callback) => {
}

// Add the chunk-manifest as a head component.
//const chunkManifest = require('!raw!public/chunk-manifest.json')
//headComponents.push(
//<script
//id="webpack-manifest"
//dangerouslySetInnerHTML={{ __html: `
////<![CDATA[
//window.webpackManifest = ${chunkManifest}
////]]>
//`}}
///>
//)
const chunkManifest = require('!raw!public/chunk-manifest.json')

headComponents.push(
<script
id="webpack-manifest"
dangerouslySetInnerHTML={{ __html: `
//<![CDATA[
window.webpackManifest = ${chunkManifest}
//]]>
` }}
/>
)

const scripts = [`commons`, `app`]
// Path chunk.
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages =
// Extract the webpack chunk manifest out of commons.js so commons.js
// doesn't get changed everytime you build. This increases the cache-hit
// rate for commons.js.
//new ChunkManifestPlugin({
//filename: "chunk-manifest.json",
//manifestVariable: "webpackManifest"
//}),
new ChunkManifestPlugin({
filename: "chunk-manifest.json",
manifestVariable: "webpackManifest"
}),
// Minify Javascript.
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand Down

0 comments on commit 8d16905

Please sign in to comment.