You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/concepts/index.md
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,14 @@ contributors:
9
9
- jimrfenner
10
10
- TheDutchCoder
11
11
- adambraimbridge
12
+
- EugeneHlushko
12
13
---
13
14
14
15
At its core, *webpack* is a _static module bundler_ for modern JavaScript applications. When webpack processes your application, it recursively builds a _dependency graph_ that includes every module your application needs, then packages all of those modules into one or more _bundles_.
15
16
16
17
T> Learn more about JavaScript modules and webpack modules [here](/concepts/modules).
17
18
18
-
It is [incredibly configurable](/configuration), but to get started you only need to understand four **Core Concepts**:
19
+
Since v4.0.0 webpack does not require a configuration file. Nevertheless, it is [incredibly configurable](/configuration). To get started you only need to understand four **Core Concepts**:
19
20
20
21
- Entry
21
22
- Output
@@ -33,6 +34,8 @@ Every dependency is then processed and outputted into files called *bundles*, wh
33
34
34
35
You can specify an entry point (or multiple entry points) by configuring the `entry` property in the [webpack configuration](/configuration).
35
36
37
+
T> `entry` defaults to `./src`
38
+
36
39
Here's the simplest example of an `entry` configuration:
37
40
38
41
__webpack.config.js__
@@ -50,6 +53,8 @@ T> You can configure the `entry` property in various ways depending the needs of
50
53
51
54
The **output** property tells webpack where to emit the *bundles* it creates and how to name these files. You can configure this part of the process by specifying an `output` field in your configuration:
52
55
56
+
T> `output.path` defaults to `./dist`
57
+
53
58
__webpack.config.js__
54
59
55
60
```javascript
@@ -90,9 +95,7 @@ __webpack.config.js__
90
95
constpath=require('path');
91
96
92
97
constconfig= {
93
-
entry:'./path/to/my/entry/file.js',
94
98
output: {
95
-
path:path.resolve(__dirname, 'dist'),
96
99
filename:'my-first-webpack.bundle.js'
97
100
},
98
101
module: {
@@ -127,14 +130,8 @@ In order to use a plugin, you need to `require()` it and add it to the `plugins`
127
130
```javascript
128
131
constHtmlWebpackPlugin=require('html-webpack-plugin'); //installed via npm
0 commit comments