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 1111 "author" : " " ,
1212 "license" : " ISC" ,
1313 "devDependencies" : {
14- "html-webpack-plugin" : " ^2.30.1 " ,
14+ "html-webpack-plugin" : " ^3.2.0 " ,
1515 "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 "
1818 },
1919 "dependencies" : {
2020 "videostream" : " ^2.4.2"
Original file line number Diff line number Diff line change 11'use strict'
22
33const path = require ( 'path' )
4- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' )
4+ const TerserPlugin = require ( 'terser -webpack-plugin' )
55const HtmlWebpackPlugin = require ( 'html-webpack-plugin' )
66
77module . exports = {
@@ -10,18 +10,44 @@ module.exports = {
1010 './index.js'
1111 ] ,
1212 plugins : [
13- new UglifyJsPlugin ( {
14- sourceMap : true ,
15- uglifyOptions : {
16- mangle : false ,
17- compress : false
18- }
19- } ) ,
2013 new HtmlWebpackPlugin ( {
2114 title : 'IPFS Videostream example' ,
2215 template : 'index.html'
2316 } )
2417 ] ,
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+ } ,
2551 output : {
2652 path : path . join ( __dirname , 'dist' ) ,
2753 filename : 'bundle.js'
You can’t perform that action at this time.
0 commit comments