Added link=“prefetch” tags

This commit is contained in:
Jori Lallo
2018-01-21 22:24:10 -08:00
parent fa1b6f9b4f
commit bc403faa8e
6 changed files with 83 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
commonWebpackConfig = require('./webpack.config');
@@ -17,27 +18,23 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
},
stats: "normal"
});
productionWebpackConfig.plugins.push(
productionWebpackConfig.plugins = [
...productionWebpackConfig.plugins,
new ManifestPlugin(),
new HtmlWebpackPlugin({
template: 'server/static/index.html',
})
);
productionWebpackConfig.plugins.push(
new ExtractTextPlugin({ filename: 'styles.[hash].css' })
);
productionWebpackConfig.plugins.push(
}),
new ExtractTextPlugin({ filename: 'styles.[hash].css' }),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
})
);
productionWebpackConfig.plugins.push(
}),
new webpack.DefinePlugin({
'process.env': {
URL: JSON.stringify(process.env.URL),
NODE_ENV: JSON.stringify('production'),
GOOGLE_ANALYTICS_ID: JSON.stringify(process.env.GOOGLE_ANALYTICS_ID),
},
})
);
}),
];
module.exports = productionWebpackConfig;