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: README.md
+15-8Lines changed: 15 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
14
14
# source-map-loader
15
15
16
-
Extracts source maps from existing source files (from their <code>sourceMappingURL</code>).
16
+
Extracts source maps from existing source files (from their `<code>sourceMappingURL</code>`).
17
17
18
18
## Getting Started
19
19
@@ -35,7 +35,7 @@ or
35
35
pnpm add -D source-map-loader
36
36
```
37
37
38
-
Then add the plugin to your `webpack`config. For example:
38
+
Then add the loader to your `webpack`configuration. For example:
39
39
40
40
**file.js**
41
41
@@ -60,14 +60,20 @@ module.exports = {
60
60
```
61
61
62
62
The `source-map-loader` extracts existing source maps from all JavaScript entries.
63
-
This includes both inline source maps as well as those linked via URL.
63
+
This includes both inline source maps as well as those linked via a `sourceMappingURL`.
64
+
64
65
All source map data is passed to webpack for processing as per a chosen [source map style](https://webpack.js.org/configuration/devtool/) specified by the `devtool` option in [webpack.config.js](https://webpack.js.org/configuration/).
65
-
This loader is especially useful when using 3rd-party libraries having their own source maps.
66
-
If not extracted and processed into the source map of the webpack bundle, browsers may misinterpret source map data. `source-map-loader` allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved.
66
+
67
+
This loader is especially useful when using third-party libraries having their own source maps.
68
+
If not extracted and processed into the source map of the webpack bundle, browsers may misinterpret or ignore source map data.
69
+
70
+
The `source-map-loader` allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved.
71
+
67
72
The `source-map-loader` will extract from any JavaScript file, including those in the `node_modules` directory.
73
+
68
74
Be mindful in setting [include](https://webpack.js.org/configuration/module/#ruleinclude) and [exclude](https://webpack.js.org/configuration/module/#ruleexclude) rule conditions to maximize bundling performance.
69
75
70
-
And run `webpack` via your preferred method.
76
+
Finally, run `webpack`using the method you normally use (e.g., via CLI or an npm script).
71
77
72
78
## Options
73
79
@@ -82,7 +88,7 @@ Default: `undefined`
82
88
83
89
Allows you to specify the behavior of the loader for `SourceMappingURL` comment.
84
90
85
-
The function must return one of the values:
91
+
The function must return one of the following values:
86
92
87
93
-`true` or `'consume'` - consume the source map and remove `SourceMappingURL` comment (default behavior)
88
94
-`false` or `'remove'` - do not consume the source map and remove `SourceMappingURL` comment
@@ -150,7 +156,8 @@ More information about the `ignoreWarnings` option can be found [here](https://w
150
156
151
157
## Contributing
152
158
153
-
Please take a moment to read our contributing guidelines if you haven't yet done so.
159
+
We welcome all contributions!
160
+
If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.
0 commit comments