diff --git a/generator/src/develop.js b/generator/src/develop.js index 4382e1d26..3b4b6ecaf 100644 --- a/generator/src/develop.js +++ b/generator/src/develop.js @@ -2,6 +2,7 @@ const webpack = require("webpack"); const middleware = require("webpack-dev-middleware"); const path = require("path"); const HTMLWebpackPlugin = require("html-webpack-plugin"); +const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); const CopyPlugin = require("copy-webpack-plugin"); const PrerenderSPAPlugin = require("prerender-spa-plugin"); const merge = require("webpack-merge"); @@ -159,6 +160,10 @@ function webpackOptions( inject: "head", template: path.resolve(__dirname, "template.html") }), + new ScriptExtHtmlWebpackPlugin({ + preload: /\.js$/, + defaultAttribute: 'defer' + }), new FaviconsWebpackPlugin({ logo: path.resolve(process.cwd(), `./${manifestConfig.sourceIcon}`), favicons: { diff --git a/generator/src/template.html b/generator/src/template.html index 5859a4725..085202258 100644 --- a/generator/src/template.html +++ b/generator/src/template.html @@ -1,7 +1,7 @@ - +