Skip to content

Commit a9b06a6

Browse files
authoredMar 3, 2021
docs(readme): add example to skip minimizing source files (#588)
1 parent f2c1bc8 commit a9b06a6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 

‎README.md

+23
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,29 @@ Result:
10431043
"newdirectory/nested/nestedfile.txt",
10441044
```
10451045

1046+
#### Skip running JavaScript files through a minimizer
1047+
1048+
Useful if you need to simply copy `*.js` files to destination "as is" without evaluating and minimizing them using Terser.
1049+
1050+
**webpack.config.js**
1051+
1052+
```js
1053+
module.exports = {
1054+
plugins: [
1055+
new CopyPlugin({
1056+
patterns: [
1057+
"relative/path/to/file.ext",
1058+
{
1059+
from: "**/*",
1060+
// Terser skip this file for minimization
1061+
info: { minimized: true },
1062+
},
1063+
],
1064+
}),
1065+
],
1066+
};
1067+
```
1068+
10461069
## Contributing
10471070

10481071
Please take a moment to read our contributing guidelines if you haven't yet done so.

0 commit comments

Comments
 (0)
Please sign in to comment.