diff --git a/package.json b/package.json index 23a3477e7..f7bf3aa43 100644 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "get-port": "^3.1.0", "html-webpack-exclude-assets-plugin": "0.0.5", "html-webpack-plugin": "^2.28.0", + "html-webpack-wait-for-assets-plugin": "^1.0.0", "inquirer": "^3.2.0", "ip": "^1.1.5", "isomorphic-unfetch": "^2.0.0", diff --git a/src/lib/webpack/webpack-client-config.js b/src/lib/webpack/webpack-client-config.js index f67cdcd54..82a72bc10 100644 --- a/src/lib/webpack/webpack-client-config.js +++ b/src/lib/webpack/webpack-client-config.js @@ -13,6 +13,7 @@ import { import devServer from '@webpack-blocks/dev-server2'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import HtmlWebpackExcludeAssetsPlugin from 'html-webpack-exclude-assets-plugin'; +import HtmlWebpackWaitForAssetsPlugin from 'html-webpack-wait-for-assets-plugin'; import ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin'; import CopyWebpackPlugin from 'copy-webpack-plugin'; import SWPrecacheWebpackPlugin from 'sw-precache-webpack-plugin'; @@ -232,6 +233,9 @@ const htmlPlugin = (config, src) => { new ScriptExtHtmlWebpackPlugin({ // inline: 'bundle.js', defaultAttribute: 'defer' + }), + new HtmlWebpackWaitForAssetsPlugin({ + assets: [resolve(config.dest, './ssr-build/ssr-bundle.js')] }) ])); };