Skip to content

Commit c32b715

Browse files
committed
Normalize guide dependency versions
1 parent c82340e commit c32b715

File tree

7 files changed

+44
-44
lines changed

7 files changed

+44
-44
lines changed

src/content/guides/asset-management.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ cacheable modules 539 KiB
166166
modules by path ./src/ 965 bytes
167167
./src/index.js + 1 modules 639 bytes [built] [code generated]
168168
./node_modules/css-loader/dist/cjs.js!./src/style.css 326 bytes [built] [code generated]
169-
webpack 5.4.0 compiled successfully in 2231 ms
169+
webpack 5.x.x compiled successfully in 2231 ms
170170
```
171171

172172
Open up `dist/index.html` in your browser again and you should see that `Hello webpack` is now styled in red. To see what webpack did, inspect the page (don't view the page source, as it won't show you the result, because the `<style>` tag is dynamically created by JavaScript) and look at the page's head tags. It should contain the style block that we imported in `index.js`.
@@ -285,7 +285,7 @@ cacheable modules 540 KiB (javascript) 9.88 KiB (asset)
285285
./src/index.js + 1 modules 794 bytes [built] [code generated]
286286
./src/icon.png 42 bytes (javascript) 9.88 KiB (asset) [built] [code generated]
287287
./node_modules/css-loader/dist/cjs.js!./src/style.css 648 bytes [built] [code generated]
288-
webpack 5.4.0 compiled successfully in 1972 ms
288+
webpack 5.x.x compiled successfully in 1972 ms
289289
```
290290

291291
If all went well, you should now see your icon as a repeating background, as well as an `img` element beside our `Hello webpack` text. If you inspect this element, you'll see that the actual filename has changed to something like `29822eaa871e8eadeaa4.png`. This means webpack found our file in the `src` folder and processed it!
@@ -396,7 +396,7 @@ cacheable modules 541 KiB (javascript) 43.1 KiB (asset)
396396
./src/icon.png 42 bytes (javascript) 9.88 KiB (asset) [built] [code generated]
397397
./src/my-font.woff2 42 bytes (javascript) 14.5 KiB (asset) [built] [code generated]
398398
./src/my-font.woff 42 bytes (javascript) 18.8 KiB (asset) [built] [code generated]
399-
webpack 5.4.0 compiled successfully in 2142 ms
399+
webpack 5.x.x compiled successfully in 2142 ms
400400
```
401401

402402
Open up `dist/index.html` again and see if our `Hello webpack` text has changed to the new font. If all is well, you should see the changes.

src/content/guides/code-splitting.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cacheable modules 530 KiB
118118
./src/index.js 257 bytes [built] [code generated]
119119
./src/another-module.js 84 bytes [built] [code generated]
120120
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
121-
webpack 5.4.0 compiled successfully in 245 ms
121+
webpack 5.x.x compiled successfully in 245 ms
122122
```
123123

124124
As mentioned there are some pitfalls to this approach:
@@ -216,7 +216,7 @@ cacheable modules 530 KiB
216216
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
217217
./src/another-module.js 84 bytes [built] [code generated]
218218
./src/index.js 257 bytes [built] [code generated]
219-
webpack 5.4.0 compiled successfully in 249 ms
219+
webpack 5.x.x compiled successfully in 249 ms
220220
```
221221

222222
As you can see there's another `runtime.bundle.js` file generated besides `shared.bundle.js`, `index.bundle.js` and `another.bundle.js`.
@@ -271,7 +271,7 @@ cacheable modules 530 KiB
271271
./src/index.js 257 bytes [built] [code generated]
272272
./src/another-module.js 84 bytes [built] [code generated]
273273
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
274-
webpack 5.4.0 compiled successfully in 241 ms
274+
webpack 5.x.x compiled successfully in 241 ms
275275
```
276276

277277
Here are some other useful plugins and loaders provided by the community for splitting code:
@@ -373,7 +373,7 @@ runtime modules 7.37 KiB 11 modules
373373
cacheable modules 530 KiB
374374
./src/index.js 434 bytes [built] [code generated]
375375
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
376-
webpack 5.4.0 compiled successfully in 268 ms
376+
webpack 5.x.x compiled successfully in 268 ms
377377
```
378378

379379
T> You can also use magic comment `webpackExports` with `import()` to expose specific exports from a dynamically imported module:

src/content/guides/development.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ cacheable modules 530 KiB
122122
./src/index.js 406 bytes [built] [code generated]
123123
./src/print.js 83 bytes [built] [code generated]
124124
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
125-
webpack 5.4.0 compiled successfully in 706 ms
125+
webpack 5.x.x compiled successfully in 706 ms
126126
```
127127

128128
Now open the resulting `index.html` file in your browser. Click the button and look in your console where the error is displayed. The error should say something like this:
@@ -171,12 +171,12 @@ Let's add an npm script that will start webpack's Watch Mode:
171171
"author": "",
172172
"license": "ISC",
173173
"devDependencies": {
174-
"html-webpack-plugin": "^5.0.0",
175-
"webpack": "^5.4.0",
176-
"webpack-cli": "^6.0.0"
174+
"html-webpack-plugin": "^5.6.6",
175+
"webpack": "^5.105.0",
176+
"webpack-cli": "^7.0.0"
177177
},
178178
"dependencies": {
179-
"lodash": "^4.17.20"
179+
"lodash": "^4.17.21"
180180
}
181181
}
182182
```
@@ -273,13 +273,13 @@ Let's add a script to easily run the dev server as well:
273273
"author": "",
274274
"license": "ISC",
275275
"devDependencies": {
276-
"html-webpack-plugin": "^5.0.0",
277-
"webpack": "^5.4.0",
278-
"webpack-cli": "^6.0.0",
279-
"webpack-dev-server": "^5.0.0"
276+
"html-webpack-plugin": "^5.6.6",
277+
"webpack": "^5.105.0",
278+
"webpack-cli": "^7.0.0",
279+
"webpack-dev-server": "^5.2.3"
280280
},
281281
"dependencies": {
282-
"lodash": "^4.17.20"
282+
"lodash": "^4.17.21"
283283
}
284284
}
285285
```
@@ -399,15 +399,15 @@ Now add an npm script to make it a little easier to run the server:
399399
"author": "",
400400
"license": "ISC",
401401
"devDependencies": {
402-
"express": "^4.17.1",
403-
"html-webpack-plugin": "^5.0.0",
404-
"webpack": "^5.4.0",
405-
"webpack-cli": "^6.0.0",
406-
"webpack-dev-middleware": "^4.0.2",
407-
"webpack-dev-server": "^5.0.0"
402+
"express": "^5.2.1",
403+
"html-webpack-plugin": "^5.6.6",
404+
"webpack": "^5.105.0",
405+
"webpack-cli": "^7.0.0",
406+
"webpack-dev-middleware": "^8.0.3",
407+
"webpack-dev-server": "^5.2.3"
408408
},
409409
"dependencies": {
410-
"lodash": "^4.17.20"
410+
"lodash": "^4.17.21"
411411
}
412412
}
413413
```
@@ -425,12 +425,12 @@ Example app listening on port 3000!
425425
<i> ./src/index.js 406 bytes [built] [code generated]
426426
<i> ./src/print.js 83 bytes [built] [code generated]
427427
<i> ./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
428-
<i> webpack 5.4.0 compiled successfully in 709 ms
428+
<i> webpack 5.x.x compiled successfully in 709 ms
429429
<i> [webpack-dev-middleware] Compiled successfully.
430430
<i> [webpack-dev-middleware] Compiling...
431431
<i> [webpack-dev-middleware] assets by status 1.38 MiB [cached] 2 assets
432432
<i> cached modules 530 KiB (javascript) 1.9 KiB (runtime) [cached] 12 modules
433-
<i> webpack 5.4.0 compiled successfully in 19 ms
433+
<i> webpack 5.x.x compiled successfully in 19 ms
434434
<i> [webpack-dev-middleware] Compiled successfully.
435435
```
436436

src/content/guides/getting-started.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Webpack is a good fit when your application needs a customizable build pipeline:
3434

3535
Webpack is used to efficiently compile JavaScript modules. Once [installed](/guides/installation), you can interact with webpack either from its [CLI](/api/cli) or [API](/api/node). If you're still new to webpack, please read through the [core concepts](/concepts) and [this comparison](/comparison) to learn why you might use it over the other tools that are out in the community.
3636

37-
W> The minimum supported Node.js version to run webpack 5 is 10.13.0 (LTS)
37+
W> The examples in this guide use `webpack-cli` 7, which requires Node.js 20.9.0 or later.
3838

3939
<StackBlitzPreview example="getting-started?terminal=" />
4040

@@ -149,8 +149,8 @@ T> If you want to learn more about the inner workings of `package.json`, then we
149149
"author": "",
150150
"license": "MIT",
151151
"devDependencies": {
152-
"webpack": "^5.106.2",
153-
"webpack-cli": "^7.0.2"
152+
"webpack": "^5.105.0",
153+
"webpack-cli": "^7.0.0"
154154
}
155155
}
156156
```
@@ -369,8 +369,8 @@ Given it's not particularly fun to run a local copy of webpack from the CLI, we
369369
"author": "",
370370
"license": "ISC",
371371
"devDependencies": {
372-
"webpack": "^5.106.2",
373-
"webpack-cli": "^7.0.2"
372+
"webpack": "^5.105.0",
373+
"webpack-cli": "^7.0.0"
374374
},
375375
"dependencies": {
376376
"lodash": "^4.17.21"

src/content/guides/output-management.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ cacheable modules 530 KiB
127127
./src/index.js 406 bytes [built] [code generated]
128128
./src/print.js 83 bytes [built] [code generated]
129129
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
130-
webpack 5.4.0 compiled successfully in 1996 ms
130+
webpack 5.x.x compiled successfully in 1996 ms
131131
```
132132

133133
We can see that webpack generates our `print.bundle.js` and `index.bundle.js` files, which we also specified in our `index.html` file. if you open `index.html` in your browser, you can see what happens when you click the button.
@@ -187,7 +187,7 @@ cacheable modules 530 KiB
187187
./src/index.js 406 bytes [built] [code generated]
188188
./src/print.js 83 bytes [built] [code generated]
189189
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
190-
webpack 5.4.0 compiled successfully in 2189 ms
190+
webpack 5.x.x compiled successfully in 2189 ms
191191
```
192192

193193
If you open `index.html` in your code editor, you'll see that the `HtmlWebpackPlugin` has created an entirely new file for you and that all the bundles are automatically added.

src/content/guides/production.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ Now, let's modify our npm scripts to use the new configuration files. For the `s
139139
"author": "",
140140
"license": "ISC",
141141
"devDependencies": {
142-
"css-loader": "^0.28.4",
143-
"csv-loader": "^2.1.1",
144-
"express": "^4.15.3",
145-
"file-loader": "^0.11.2",
146-
"html-webpack-plugin": "^2.29.0",
147-
"style-loader": "^0.18.2",
148-
"webpack": "^4.30.0",
149-
"webpack-dev-middleware": "^1.12.0",
150-
"webpack-dev-server": "^2.9.1",
151-
"webpack-merge": "^4.1.0",
142+
"css-loader": "^7.1.3",
143+
"csv-loader": "^3.0.5",
144+
"express": "^5.2.1",
145+
"html-webpack-plugin": "^5.6.6",
146+
"style-loader": "^4.0.0",
147+
"webpack": "^5.105.0",
148+
"webpack-cli": "^7.0.0",
149+
"webpack-dev-middleware": "^8.0.3",
150+
"webpack-dev-server": "^5.2.3",
151+
"webpack-merge": "^6.0.1",
152152
"xml-loader": "^1.2.1"
153153
}
154154
}

src/content/guides/shimming.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ runtime modules 344 bytes 2 modules
115115
cacheable modules 530 KiB
116116
./src/index.js 191 bytes [built] [code generated]
117117
./node_modules/lodash/lodash.js 530 KiB [built] [code generated]
118-
webpack 5.4.0 compiled successfully in 2910 ms
118+
webpack 5.x.x compiled successfully in 2910 ms
119119
```
120120

121121
We can also use the `ProvidePlugin` to expose a single export of a module by configuring it with an "array path" (e.g. `[module, child, ...children?]`). So let's imagine we only wanted to provide the `join` method from `lodash` wherever it's invoked:

0 commit comments

Comments
 (0)