@@ -4,9 +4,6 @@ var webpackStream = require('webpack-stream');
4
4
var webpack = require ( 'webpack' ) ;
5
5
var createWebpackConfig = require ( './webpack.base' ) ;
6
6
7
- var Uglify = require ( 'uglifyjs-webpack-plugin' ) ;
8
- var uglifyPlugin = new Uglify ( ) ;
9
-
10
7
// entry points for both configs
11
8
var npmEntry = './index.js' ;
12
9
var classicEntry = [ 'babel-polyfill' , npmEntry ] ;
@@ -15,36 +12,39 @@ var classicEntry = ['babel-polyfill', npmEntry];
15
12
gulp . task ( 'build-lib-sourcemap' , [ 'jsrsasign' ] , function ( ) {
16
13
// run webpack
17
14
return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
15
+ mode : 'development' ,
18
16
entry : npmEntry ,
19
17
output : {
20
18
filename :'oidc-client.js' ,
21
19
libraryTarget :'umd'
22
20
} ,
23
21
plugins : [ ] ,
24
22
devtool :'inline-source-map'
25
- } ) ) )
23
+ } ) , webpack ) )
26
24
. pipe ( gulp . dest ( 'lib/' ) ) ;
27
25
} ) ;
28
26
29
27
// npm compliant build without source-maps & minified
30
28
gulp . task ( 'build-lib-min' , [ 'jsrsasign' ] , function ( ) {
31
29
// run webpack
32
30
return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
31
+ mode : 'production' ,
33
32
entry : npmEntry ,
34
33
output : {
35
34
filename :'oidc-client.min.js' ,
36
35
libraryTarget :'umd' ,
37
36
} ,
38
- plugins : [ uglifyPlugin ] ,
37
+ plugins : [ ] ,
39
38
devtool : false
40
- } ) ) )
39
+ } ) , webpack ) )
41
40
. pipe ( gulp . dest ( 'lib/' ) ) ;
42
41
} ) ;
43
42
44
43
// classic build with sourcemaps
45
44
gulp . task ( 'build-dist-sourcemap' , [ 'jsrsasign' ] , function ( ) {
46
45
// run webpack
47
46
return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
47
+ mode : 'development' ,
48
48
entry : classicEntry ,
49
49
output : {
50
50
filename :'oidc-client.js' ,
@@ -53,23 +53,24 @@ gulp.task('build-dist-sourcemap', ['jsrsasign'], function() {
53
53
} ,
54
54
plugins : [ ] ,
55
55
devtool :'inline-source-map'
56
- } ) ) )
56
+ } ) , webpack ) )
57
57
. pipe ( gulp . dest ( 'dist/' ) ) ;
58
58
} ) ;
59
59
60
60
// classic build without sourcemaps & minified
61
61
gulp . task ( 'build-dist-min' , [ 'jsrsasign' ] , function ( ) {
62
62
// run webpack
63
63
return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
64
+ mode : 'production' ,
64
65
entry : classicEntry ,
65
66
output : {
66
67
filename :'oidc-client.min.js' ,
67
68
libraryTarget :'var' ,
68
69
library :'Oidc'
69
70
} ,
70
- plugins : [ uglifyPlugin ] ,
71
+ plugins : [ ] ,
71
72
devtool : false
72
- } ) ) )
73
+ } ) , webpack ) )
73
74
. pipe ( gulp . dest ( 'dist/' ) ) ;
74
75
} ) ;
75
76
0 commit comments