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/configuration/devtool.md
+35-19Lines changed: 35 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,16 @@ sort: 10
4
4
contributors:
5
5
- sokra
6
6
- skipjack
7
+
- SpaceK33z
7
8
---
8
9
9
-
?> Description...
10
+
This option controls if and how Source Maps are generated.
10
11
11
12
## `devtool`
12
13
13
-
`string`
14
+
`string``false`
14
15
15
-
Choose a style of [source mapping](http://blog.teamtreehouse.com/introduction-source-maps) to enhance the debugging process. Be aware that the following options can affect build and rebuild speed dramatically...
16
-
17
-
`eval` - Each module is executed with `eval` and `//@ sourceURL`
18
-
19
-
`source-map` - A full SourceMap is emitted
20
-
21
-
`hidden-source-map` - Same as `source-map`, but doesn't add a reference comment to the bundle. Useful if you only want SourceMaps to map error stack traces from error reports, but don't want to expose your SourceMap for the browser development tools.
22
-
23
-
`inline-source-map` - A SourceMap is added as DataUrl to the bundle
24
-
25
-
`eval-source-map` - Each module is executed with `eval` and a SourceMap is added as DataUrl to the `eval`
26
-
27
-
`cheap-source-map` - A SourceMap without column-mappings ignoring loaded source maps
28
-
29
-
`cheap-module-source-map` - A SourceMap without column-mappings that simplifies loaded source maps to a single mapping per line
16
+
Choose a style of [source mapping](http://blog.teamtreehouse.com/introduction-source-maps) to enhance the debugging process. These values can affect build and rebuild speed dramatically.
@@ -38,7 +25,36 @@ Choose a style of [source mapping](http://blog.teamtreehouse.com/introduction-so
38
25
eval-source-map | -- | + | no | original source
39
26
source-map | -- | -- | yes | original source
40
27
28
+
Some of these values are suited for development and some for production. For development you typically want very fast Source Maps at the cost of bundle size, but for production you want separate Source Maps that are accurate.
29
+
30
+
W> There are some issues with Source Maps in Chrome. [We need your help!](https://github.com/webpack/webpack/issues/3165).
31
+
32
+
### For development
33
+
34
+
`eval` - Each module is executed with `eval()` and `//@ sourceURL`. This is very fast. The main disadvantage is that it doesn't display line numbers correctly since it gets mapped to transpiled code instead of the original code.
35
+
36
+
`inline-source-map` - A SourceMap is added as DataUrl to the bundle.
37
+
38
+
`eval-source-map` - Each module is executed with `eval()` and a SourceMap is added as DataUrl to the `eval()`. Initially it is slow, but it provides fast rebuild speed and yields real files. Line numbers are correctly mapped since it gets mapped to the original code.
39
+
40
+
`cheap-module-eval-source-map` - Like `eval-source-map`, each module is executed with `eval()` and a SourceMap is added as DataUrl to the `eval()`. It is "cheap" because it doesn't have column mappings, it only maps line numbers.
41
+
42
+
### For production
43
+
44
+
`source-map` - A full SourceMap is emitted as a separate file. It adds a reference comment to the bundle so development tools know where to find it.
45
+
46
+
`hidden-source-map` - Same as `source-map`, but doesn't add a reference comment to the bundle. Useful if you only want SourceMaps to map error stack traces from error reports, but don't want to expose your SourceMap for the browser development tools.
47
+
48
+
`cheap-source-map` - A SourceMap without column-mappings ignoring loaded Source Maps.
49
+
50
+
`cheap-module-source-map` - A SourceMap without column-mappings that simplifies loaded Source Maps to a single mapping per line.
51
+
52
+
T> See [`output.sourceMapFilename`](/configuration/output#output-sourcemapfilename) to customize the filenames of generated Source Maps.
53
+
54
+
?> This page needs more information to make it easier for users to choose a good option.
41
55
42
-
T> See [`output.sourceMapFilename`](/configuration/output#output-sourcemapfilename) to customize the filenames of generated source maps.
56
+
# References
43
57
44
-
?> This section is pretty much just copied over from existing docs... imo more background is needed on the different types of source mapping, maybe via links to external sites that discuss the different types of source maps in more detail.
0 commit comments