Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Add plugin to make script loading async

Jason Miller896d267de5da
diff --git a/webpack.config.js b/webpack.config.js
index 6e75cc49..6ec40a2b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -6,6 +6,7 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const HtmlPlugin = require('html-webpack-plugin');
+const ScriptExtHtmlPlugin = require('script-ext-html-webpack-plugin');
const PreloadPlugin = require('preload-webpack-plugin');
const ReplacePlugin = require('webpack-plugin-replace');
const CopyPlugin = require('copy-webpack-plugin');
@@ -181,6 +182,10 @@ module.exports = function (_, env) {
compile: true
}),
+ new ScriptExtHtmlPlugin({
+ defaultAttribute: 'async'
+ }),
+
// Inject <link rel="preload"> for resources
isProd && new PreloadPlugin({
include: 'initial'