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: content/concepts/modules.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ sort: 7
4
4
contributors:
5
5
- TheLarkInn
6
6
- simon04
7
+
- rouzbeh84
7
8
---
8
9
9
10
In [modular programming](https://en.wikipedia.org/wiki/Modular_programming), developers break programs up into discrete chunks of functionality called a _module_.
Copy file name to clipboardExpand all lines: content/concepts/output.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,14 @@ sort: 3
4
4
contributors:
5
5
- TheLarkInn
6
6
- chyipin
7
+
- rouzbeh84
7
8
---
8
9
9
10
Options affecting the output of the compilation. `output` options tell Webpack how to write the compiled files to disk. Note, that while there can be multiple `entry` points, only one `output` configuration is specified.
10
11
11
12
If you use any hashing (`[hash]` or `[chunkhash]`), make sure to have a consistent ordering of modules. Use the `OccurrenceOrderPlugin` or `recordsPath`.
12
13
13
-
# Usage
14
+
##Usage
14
15
15
16
The minimum requirements for the `output` property in your webpack config is to set its value to an object including the following two things :
16
17
@@ -31,11 +32,11 @@ const config = {
31
32
module.exports= config;
32
33
```
33
34
34
-
# Options
35
+
##Options
35
36
36
37
The following is a list of values you can pass to the `output` property.
37
38
38
-
## `output.chunkFilename`
39
+
###`output.chunkFilename`
39
40
40
41
The filename of non-entry chunks as a relative path inside the `output.path` directory.
41
42
@@ -47,7 +48,7 @@ The filename of non-entry chunks as a relative path inside the `output.path` dir
47
48
48
49
`[chunkhash]` is replaced by the hash of the chunk.
49
50
50
-
## `output.crossOriginLoading`
51
+
###`output.crossOriginLoading`
51
52
52
53
This option enables cross-origin loading of chunks.
53
54
@@ -63,9 +64,11 @@ For more information on cross-origin loading see [MDN](https://developer.mozilla
63
64
64
65
> Default: `false`
65
66
66
-
> see also [[library and externals]] see also [[Development Tools]]
67
+
> see also [[library and externals]]
67
68
68
-
## `output.devtoolLineToLine`
69
+
> see also [[Development Tools]]
70
+
71
+
### `output.devtoolLineToLine`
69
72
70
73
Enable line-to-line mapped mode for all/specified modules. Line-to-line mapped mode uses a simple SourceMap where each line of the generated source is mapped to the same line of the original source. It's a performance optimization. Only use it if your performance needs to be better and you are sure that input lines match which generated lines.
71
74
@@ -75,7 +78,7 @@ An object `{test, include, exclude}` similar to `module.loaders` enables it for
75
78
76
79
> Default: `false`
77
80
78
-
## `output.filename`
81
+
###`output.filename`
79
82
80
83
Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written. `filename` is used solely for naming the individual files.
81
84
@@ -118,7 +121,7 @@ If your configuration creates more than a single "chunk" (as with multiple entry
118
121
// writes to disk: ./build/app.js, ./build/search.js
119
122
```
120
123
121
-
## `output.hotUpdateChunkFilename`
124
+
###`output.hotUpdateChunkFilename`
122
125
123
126
The filename of the Hot Update Chunks. They are inside the `output.path` directory.
124
127
@@ -128,35 +131,35 @@ The filename of the Hot Update Chunks. They are inside the `output.path` directo
128
131
129
132
> Default: `"[id].[hash].hot-update.js"`
130
133
131
-
## `output.hotUpdateFunction`
134
+
###`output.hotUpdateFunction`
132
135
133
136
The JSONP function used by webpack for async loading of hot update chunks.
134
137
135
138
> Default: `"webpackHotUpdate"`
136
139
137
-
## `output.hotUpdateMainFilename`
140
+
###`output.hotUpdateMainFilename`
138
141
139
142
The filename of the Hot Update Main File. It is inside the `output.path` directory.
140
143
141
144
`[hash]` is replaced by the hash of the compilation. (The last hash stored in the records)
142
145
143
146
> Default: `"[hash].hot-update.json"`
144
147
145
-
## `output.jsonpFunction`
148
+
###`output.jsonpFunction`
146
149
147
150
The JSONP function used by webpack for asnyc loading of chunks.
148
151
149
152
A shorter function may reduce the file size a bit. Use a different identifier when having multiple webpack instances on a single page.
150
153
151
154
> Default: `"webpackJsonp"`
152
155
153
-
## `output.library`
156
+
###`output.library`
154
157
155
158
If set, export the bundle as library. `output.library` is the name.
156
159
157
160
Use this if you are writing a library and want to publish it as single file.
158
161
159
-
## `output.libraryTarget`
162
+
###`output.libraryTarget`
160
163
161
164
Which format to export the library:
162
165
@@ -176,7 +179,7 @@ Which format to export the library:
176
179
177
180
If `output.library` is not set, but `output.libraryTarget` is set to a value other than `var`, every property of the exported object is copied (Except `amd`, `commonjs2` and `umd`).
178
181
179
-
## `output.path`
182
+
###`output.path`
180
183
181
184
The output directory as an **absolute path** (required).
182
185
@@ -218,7 +221,7 @@ output: {
218
221
// rest of your application entry
219
222
```
220
223
221
-
## `output.sourceMapFilename`
224
+
###`output.sourceMapFilename`
222
225
223
226
The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory.
Copy file name to clipboardExpand all lines: content/concepts/plugins.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ sort: 5
4
4
contributors:
5
5
- TheLarkInn
6
6
- jhnns
7
+
- rouzbeh84
7
8
---
8
9
9
10
**Plugins** are the [backbone](https://github.com/webpack/tapable) of webpack. webpack itself is built on the **same plugin system** that you use in your webpack configuration!
Copy file name to clipboardExpand all lines: content/concepts/targets.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ title: Targets
3
3
sort: 10
4
4
contributors:
5
5
- TheLarkInn
6
+
- rouzbeh84
6
7
---
7
8
8
9
Because JavaScript can be written for both server and browser, webpack offers multiple deployment _targets_ that you can set in your webpack [configuration](/configuration).
0 commit comments