From b9febdbc539dff0bc1f8babd2aeaa1db99ff9509 Mon Sep 17 00:00:00 2001 From: Luis Rodriguez Date: Wed, 30 Dec 2020 22:34:11 -0500 Subject: [PATCH] Update lazy-loading.md I had to add the CleanWebpackPlugin and the HtmlWebpackPlugin in the webpack.config.js file in order to get the same results that were shown in the example after the npm run build command was ran. These two plugins were not present in the Code Splitting subsection of the Guides section. --- src/content/guides/lazy-loading.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/content/guides/lazy-loading.md b/src/content/guides/lazy-loading.md index c0e8c82d2daf..3bffae329762 100644 --- a/src/content/guides/lazy-loading.md +++ b/src/content/guides/lazy-loading.md @@ -39,6 +39,31 @@ webpack-demo |- /node_modules ``` +__webpack.config.js__ + +``` diff + const path = require("path"); ++ const { CleanWebpackPlugin } = require("clean-webpack-plugin"); ++ const HtmlWebpackPlugin = require("html-webpack-plugin"); + + module.exports = { + mode: "development", + entry: { + index: "./src/index.js", + }, ++ plugins: [ ++ new CleanWebpackPlugin(), ++ new HtmlWebpackPlugin({ ++ title: "Production", ++ }), ++ ], + output: { + filename: "[name].bundle.js", + path: path.resolve(__dirname, "dist"), + }, +}; +``` + __src/print.js__ ``` js