From fa57ed946cd30ad4f358cfff043a553851515daa Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 16 Dec 2019 19:48:27 +0100 Subject: [PATCH] extend persistent-caching example with bigger module concatenation --- examples/persistent-caching/README.md | 43 ++++++++++++++++++++++--- examples/persistent-caching/example.js | 3 ++ examples/persistent-caching/template.md | 8 +++++ package.json | 1 + yarn.lock | 5 +++ 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/examples/persistent-caching/README.md b/examples/persistent-caching/README.md index f95723e5c..0978b4986 100644 --- a/examples/persistent-caching/README.md +++ b/examples/persistent-caching/README.md @@ -9,6 +9,9 @@ import "react-dom"; import "acorn"; import "core-js"; import "date-fns"; +import "lodash"; +import * as _ from "lodash-es"; +console.log(_); ``` # webpack.config.js @@ -49,13 +52,43 @@ module.exports = (env = "development") => ({ # Info +## Unoptimized + ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.6 - Asset Size -output.js 2 MiB [emitted] [name: main] +Version: webpack 5.0.0-beta.9 + Asset Size +output.js 4.04 MiB [emitted] [name: main] Entrypoint main = output.js -chunk output.js (main) 1.74 MiB (javascript) 0 bytes (runtime) [entry] +chunk output.js (main) 2.85 MiB (javascript) 0 bytes (runtime) [entry] > ./example.js main - 529 chunk modules + 1172 chunk modules +``` + +## Production mode + +``` +Hash: 0a1b2c3d4e5f6a7b8c9d +Version: webpack 5.0.0-beta.9 + Asset Size + output.js 510 KiB [emitted] [big] [name: main] +output.js.LICENSE 1.49 KiB [emitted] +Entrypoint main [big] = output.js +chunk output.js (main) 1.8 MiB (javascript) 0 bytes (runtime) [entry] + > ./example.js main + 530 chunk modules + +WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). +This can impact web performance. +Assets: + output.js (510 KiB) + +WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. +Entrypoints: + main (510 KiB) + output.js + +WARNING in webpack performance recommendations: +You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. +For more info visit https://webpack.js.org/guides/code-splitting/ ``` diff --git a/examples/persistent-caching/example.js b/examples/persistent-caching/example.js index 786fd8e0e..f04e6a667 100644 --- a/examples/persistent-caching/example.js +++ b/examples/persistent-caching/example.js @@ -6,3 +6,6 @@ import "react-dom"; import "acorn"; import "core-js"; import "date-fns"; +import "lodash"; +import * as _ from "lodash-es"; +console.log(_); diff --git a/examples/persistent-caching/template.md b/examples/persistent-caching/template.md index 890a19bfa..2df3585bd 100644 --- a/examples/persistent-caching/template.md +++ b/examples/persistent-caching/template.md @@ -12,6 +12,14 @@ _{{webpack.config.js}}_ # Info +## Unoptimized + ``` _{{stdout}}_ ``` + +## Production mode + +``` +_{{production:stdout}}_ +``` diff --git a/package.json b/package.json index fa9972363..cfd4dfe92 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "less-loader": "^5.0.0", "lint-staged": "^9.2.1", "lodash": "^4.17.4", + "lodash-es": "^4.17.15", "memory-fs": "~0.5.0", "mini-css-extract-plugin": "^0.8.0", "mini-svg-data-uri": "^1.1.3", diff --git a/yarn.lock b/yarn.lock index 7ee1a3eae..c12cb554c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3916,6 +3916,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash-es@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78" + integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ== + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"