Adds single-pass prerendering via a new prerender-loader

This commit is contained in:
Jason Miller
2018-04-17 14:04:55 -04:00
parent be8fae10f8
commit 3ba0a5a22a
6 changed files with 218 additions and 73 deletions

View File

@@ -165,15 +165,14 @@ module.exports = function(_, env) {
]),
// For now we're not doing SSR.
new HtmlWebpackPlugin({
new HtmlPlugin({
filename: path.join(__dirname, 'build/index.html'),
template: '!!ejs-loader!src/index.html',
// template: '!!'+path.join(__dirname, 'config/prerender-loader')+'!src/index.html',
template: '!' + path.join(__dirname, 'config/prerender-loader') + '?string' + (isProd ? '' : '&disabled') + '!src/index.html',
minify: isProd && {
collapseWhitespace: true,
removeScriptTypeAttributes: true,
removeRedundantAttributes: true,
removeStyleLinkTypeAttributes: true,
removeRedundantAttributes: true,
removeComments: true
},
manifest: readJson('./src/manifest.json'),