Initial version of webpack-inline-critical-css-plugin

This commit is contained in:
Jason Miller
2018-04-02 22:51:01 -04:00
parent 2d02562753
commit 7bf2ba4690
4 changed files with 416 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ const PreloadWebpackPlugin = require('preload-webpack-plugin');
const ReplacePlugin = require('webpack-plugin-replace');
const CopyPlugin = require('copy-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const HtmlInlineCssPlugin = require('./config/html-webpack-inline-critical-css-plugin');
const WatchTimestampsPlugin = require('./config/watch-timestamps-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
@@ -174,6 +175,8 @@ module.exports = function(_, env) {
// Inject <link rel="preload"> for resources
isProd && new PreloadWebpackPlugin(),
isProd && new HtmlInlineCssPlugin(),
// Inline constants during build, so they can be folded by UglifyJS.
new webpack.DefinePlugin({