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
**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**
47
+
48
+
Why?
49
+
50
+
-`eval` wraps modules in `eval("string")` and the minimizer does not handle strings.
51
+
-`cheap` has not column information and minimizer generate only a single line, which leave only a single mapping.
52
+
53
+
Using supported `devtool` values enable source map generation.
54
+
44
55
## Options
45
56
46
57
### `test`
@@ -109,98 +120,6 @@ module.exports = {
109
120
};
110
121
```
111
122
112
-
### `cache`
113
-
114
-
> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
115
-
116
-
Type: `Boolean|String`
117
-
Default: `true`
118
-
119
-
Enable file caching.
120
-
Default path to cache directory: `node_modules/.cache/terser-webpack-plugin`.
121
-
122
-
> ℹ️ If you use your own `minify` function please read the `minify` section for cache invalidation correctly.
123
-
124
-
#### `Boolean`
125
-
126
-
Enable/disable file caching.
127
-
128
-
**webpack.config.js**
129
-
130
-
```js
131
-
module.exports= {
132
-
optimization: {
133
-
minimize:true,
134
-
minimizer: [
135
-
newTerserPlugin({
136
-
cache:true,
137
-
}),
138
-
],
139
-
},
140
-
};
141
-
```
142
-
143
-
#### `String`
144
-
145
-
Enable file caching and set path to cache directory.
146
-
147
-
**webpack.config.js**
148
-
149
-
```js
150
-
module.exports= {
151
-
optimization: {
152
-
minimize:true,
153
-
minimizer: [
154
-
newTerserPlugin({
155
-
cache:'path/to/cache',
156
-
}),
157
-
],
158
-
},
159
-
};
160
-
```
161
-
162
-
### `cacheKeys`
163
-
164
-
> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
Default: `false` (see below for details around `devtool` value and `SourceMapDevToolPlugin` plugin)
258
-
259
-
**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**
260
-
261
-
Why?
262
-
263
-
-`eval` wraps modules in `eval("string")` and the minimizer does not handle strings.
264
-
-`cheap` has not column information and minimizer generate only a single line, which leave only a single mapping.
265
-
266
-
The plugin respect the [`devtool`](https://webpack.js.org/configuration/devtool/) and using the `SourceMapDevToolPlugin` plugin.
267
-
Using supported `devtool` values enable source map generation.
268
-
Using `SourceMapDevToolPlugin` with enabled the `columns` option enables source map generation.
269
-
270
-
Use source maps to map error message locations to modules (this slows down the compilation).
271
-
If you use your own `minify` function please read the `minify` section for handling source maps correctly.
0 commit comments