Skip to content

Commit 020d6b9

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(concepts) Use common formatting, provide more links, mention mod… (#2472)
* docs(concepts) use common formatting, provide more links, mention mode in core of the concepts * docs(concepts) duplicate links on the list for better ux * docs(concepts) forgot to add EugeneHlushko to contributors
1 parent 649ae3a commit 020d6b9

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/content/concepts/index.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,24 @@ contributors:
1414
- arjunsajeev
1515
- byzyk
1616
- yairhaimo
17+
- EugeneHlushko
1718
---
1819

19-
At its core, **webpack** is a _static module bundler_ for modern JavaScript applications. When webpack processes your application, it internally builds a _dependency graph_ which maps every module your project needs and generates one or more _bundles_.
20+
At its core, __webpack__ is a _static module bundler_ for modern JavaScript applications. When webpack processes your application, it internally builds a [dependency graph](/concepts/dependency-graph/) which maps every module your project needs and generates one or more _bundles_.
2021

2122
T> Learn more about JavaScript modules and webpack modules [here](/concepts/modules).
2223

23-
Since version 4.0.0, **webpack does not require a configuration file** to bundle your project, nevertheless it is [incredibly configurable](/configuration) to better fit your needs.
24+
Since version 4.0.0, __webpack does not require a configuration file__ to bundle your project, nevertheless it is [incredibly configurable](/configuration) to better fit your needs.
2425

25-
To get started you only need to understand its **Core Concepts**:
26+
To get started you only need to understand its __Core Concepts__:
2627

27-
- Entry
28-
- Output
29-
- Loaders
30-
- Plugins
28+
- [Entry](#entry)
29+
- [Output](#output)
30+
- [Loaders](#loaders)
31+
- [Plugins](#plugins)
32+
- [Mode](#mode)
3133

32-
This document is intended to give a **high-level** overview of these concepts, while providing links to detailed concept specific use cases.
34+
This document is intended to give a __high-level__ overview of these concepts, while providing links to detailed concept specific use cases.
3335

3436
For a better understanding of the ideas behind module bundlers and how they work under the hood consult these resources:
3537

@@ -40,9 +42,9 @@ For a better understanding of the ideas behind module bundlers and how they work
4042

4143
## Entry
4244

43-
An **entry point** indicates which module webpack should use to begin building out its internal *dependency graph*. webpack will figure out which other modules and libraries that entry point depends on (directly and indirectly).
45+
An __entry point__ indicates which module webpack should use to begin building out its internal [dependency graph](/concepts/dependency-graph/). webpack will figure out which other modules and libraries that entry point depends on (directly and indirectly).
4446

45-
By default its value is `./src/index.js`, but you can specify a different (or multiple entry points) by configuring the **entry** property in the [webpack configuration](/configuration). For example:
47+
By default its value is `./src/index.js`, but you can specify a different (or multiple entry points) by configuring the __entry__ property in the [webpack configuration](/configuration). For example:
4648

4749
__webpack.config.js__
4850

@@ -57,7 +59,7 @@ T> Learn more in the [entry points](/concepts/entry-points) section.
5759

5860
## Output
5961

60-
The **output** property tells webpack where to emit the *bundles* it creates and how to name these files. It defaults to `./dist/main.js` for the main output file and to the `./dist` folder for any other generated file.
62+
The __output__ property tells webpack where to emit the *bundles* it creates and how to name these files. It defaults to `./dist/main.js` for the main output file and to the `./dist` folder for any other generated file.
6163

6264
You can configure this part of the process by specifying an `output` field in your configuration:
6365

@@ -82,11 +84,11 @@ T> The `output` property has [many more configurable features](/configuration/ou
8284

8385
## Loaders
8486

85-
Out of the box, webpack only understands JavaScript files. **Loaders** allow webpack to process other types of files and convert them into valid [modules](/concepts/modules) that can be consumed by your application and added to the dependency graph.
87+
Out of the box, webpack only understands JavaScript files. __Loaders__ allow webpack to process other types of files and convert them into valid [modules](/concepts/modules) that can be consumed by your application and added to the dependency graph.
8688

8789
W> Note that the ability to `import` any type of module, e.g. `.css` files, is a feature specific to webpack and may not be supported by other bundlers or task runners. We feel this extension of the language is warranted as it allows developers to build a more accurate dependency graph.
8890

89-
At a high level, **loaders** have two properties in your webpack configuration:
91+
At a high level, __loaders__ have two properties in your webpack configuration:
9092

9193
1. The `test` property identifies which file or files should be transformed.
9294
2. The `use` property indicates which loader should be used to do the transforming.
@@ -110,7 +112,7 @@ module.exports = {
110112

111113
The configuration above has defined a `rules` property for a single module with two required properties: `test` and `use`. This tells webpack's compiler the following:
112114

113-
> "Hey webpack compiler, when you come across a path that resolves to a '.txt' file inside of a `require()`/`import` statement, **use** the `raw-loader` to transform it before you add it to the bundle."
115+
> "Hey webpack compiler, when you come across a path that resolves to a '.txt' file inside of a `require()`/`import` statement, __use__ the `raw-loader` to transform it before you add it to the bundle."
114116
115117
W> It is important to remember that when defining rules in your webpack config, you are defining them under `module.rules` and not `rules`. For your benefit, webpack will warn you if this is done incorrectly.
116118

@@ -125,7 +127,7 @@ T> Check out the [plugin interface](/api/plugins) and how to use it to extend we
125127

126128
In order to use a plugin, you need to `require()` it and add it to the `plugins` array. Most plugins are customizable through options. Since you can use a plugin multiple times in a config for different purposes, you need to create an instance of it by calling it with the `new` operator.
127129

128-
**webpack.config.js**
130+
__webpack.config.js__
129131

130132
```javascript
131133
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm

0 commit comments

Comments
 (0)