This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-11
lines changed
examples/browser-readablestream Expand file tree Collapse file tree 2 files changed +37
-11
lines changed Original file line number Diff line number Diff line change 11
11
"author" : " " ,
12
12
"license" : " ISC" ,
13
13
"devDependencies" : {
14
- "html-webpack-plugin" : " ^2.30.1 " ,
14
+ "html-webpack-plugin" : " ^3.2.0 " ,
15
15
"http-server" : " ~0.11.1" ,
16
- "uglifyjs -webpack-plugin" : " ^1.2.0 " ,
17
- "webpack" : " ^3.11.0 "
16
+ "terser -webpack-plugin" : " ^1.2.1 " ,
17
+ "webpack" : " ^4.28.4 "
18
18
},
19
19
"dependencies" : {
20
20
"videostream" : " ^2.4.2"
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const path = require ( 'path' )
4
- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' )
4
+ const TerserPlugin = require ( 'terser -webpack-plugin' )
5
5
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
6
6
7
7
module . exports = {
@@ -10,18 +10,44 @@ module.exports = {
10
10
'./index.js'
11
11
] ,
12
12
plugins : [
13
- new UglifyJsPlugin ( {
14
- sourceMap : true ,
15
- uglifyOptions : {
16
- mangle : false ,
17
- compress : false
18
- }
19
- } ) ,
20
13
new HtmlWebpackPlugin ( {
21
14
title : 'IPFS Videostream example' ,
22
15
template : 'index.html'
23
16
} )
24
17
] ,
18
+ optimization : {
19
+ minimizer : [
20
+ new TerserPlugin ( {
21
+ terserOptions : {
22
+ parse : {
23
+ // we want terser to parse ecma 8 code. However, we don't want it
24
+ // to apply any minfication steps that turns valid ecma 5 code
25
+ // into invalid ecma 5 code. This is why the 'compress' and 'output'
26
+ // sections only apply transformations that are ecma 5 safe
27
+ // https://github.com/facebook/create-react-app/pull/4234
28
+ ecma : 8
29
+ } ,
30
+ compress : {
31
+ ecma : 5 ,
32
+ warnings : false
33
+ } ,
34
+ mangle : {
35
+ safari10 : true
36
+ } ,
37
+ output : {
38
+ ecma : 5 ,
39
+ comments : false
40
+ }
41
+ } ,
42
+ // Use multi-process parallel running to improve the build speed
43
+ // Default number of concurrent runs: os.cpus().length - 1
44
+ parallel : true ,
45
+ // Enable file caching
46
+ cache : true ,
47
+ sourceMap : true
48
+ } )
49
+ ]
50
+ } ,
25
51
output : {
26
52
path : path . join ( __dirname , 'dist' ) ,
27
53
filename : 'bundle.js'
You can’t perform that action at this time.
0 commit comments