@@ -4,9 +4,6 @@ var webpackStream = require('webpack-stream');
44var webpack = require ( 'webpack' ) ;
55var createWebpackConfig = require ( './webpack.base' ) ;
66
7- var Uglify = require ( 'uglifyjs-webpack-plugin' ) ;
8- var uglifyPlugin = new Uglify ( ) ;
9-
107// entry points for both configs
118var npmEntry = './index.js' ;
129var classicEntry = [ 'babel-polyfill' , npmEntry ] ;
@@ -15,36 +12,39 @@ var classicEntry = ['babel-polyfill', npmEntry];
1512gulp . task ( 'build-lib-sourcemap' , [ 'jsrsasign' ] , function ( ) {
1613 // run webpack
1714 return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
15+ mode : 'development' ,
1816 entry : npmEntry ,
1917 output : {
2018 filename :'oidc-client.js' ,
2119 libraryTarget :'umd'
2220 } ,
2321 plugins : [ ] ,
2422 devtool :'inline-source-map'
25- } ) ) )
23+ } ) , webpack ) )
2624 . pipe ( gulp . dest ( 'lib/' ) ) ;
2725} ) ;
2826
2927// npm compliant build without source-maps & minified
3028gulp . task ( 'build-lib-min' , [ 'jsrsasign' ] , function ( ) {
3129 // run webpack
3230 return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
31+ mode : 'production' ,
3332 entry : npmEntry ,
3433 output : {
3534 filename :'oidc-client.min.js' ,
3635 libraryTarget :'umd' ,
3736 } ,
38- plugins : [ uglifyPlugin ] ,
37+ plugins : [ ] ,
3938 devtool : false
40- } ) ) )
39+ } ) , webpack ) )
4140 . pipe ( gulp . dest ( 'lib/' ) ) ;
4241} ) ;
4342
4443// classic build with sourcemaps
4544gulp . task ( 'build-dist-sourcemap' , [ 'jsrsasign' ] , function ( ) {
4645 // run webpack
4746 return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
47+ mode : 'development' ,
4848 entry : classicEntry ,
4949 output : {
5050 filename :'oidc-client.js' ,
@@ -53,23 +53,24 @@ gulp.task('build-dist-sourcemap', ['jsrsasign'], function() {
5353 } ,
5454 plugins : [ ] ,
5555 devtool :'inline-source-map'
56- } ) ) )
56+ } ) , webpack ) )
5757 . pipe ( gulp . dest ( 'dist/' ) ) ;
5858} ) ;
5959
6060// classic build without sourcemaps & minified
6161gulp . task ( 'build-dist-min' , [ 'jsrsasign' ] , function ( ) {
6262 // run webpack
6363 return gulp . src ( 'index.js' ) . pipe ( webpackStream ( createWebpackConfig ( {
64+ mode : 'production' ,
6465 entry : classicEntry ,
6566 output : {
6667 filename :'oidc-client.min.js' ,
6768 libraryTarget :'var' ,
6869 library :'Oidc'
6970 } ,
70- plugins : [ uglifyPlugin ] ,
71+ plugins : [ ] ,
7172 devtool : false
72- } ) ) )
73+ } ) , webpack ) )
7374 . pipe ( gulp . dest ( 'dist/' ) ) ;
7475} ) ;
7576
0 commit comments