Skip to content

Commit 2377dcb

Browse files
authored
Merge pull request DuendeArchive#601 from DavidRouyer/webpack4
Use Webpack 4
2 parents b0dc58d + 34b5bdb commit 2377dcb

8 files changed

+30160
-27924
lines changed

dist/oidc-client.js

Lines changed: 19065 additions & 17179 deletions
Large diffs are not rendered by default.

dist/oidc-client.min.js

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ var concat = require('gulp-concat');
33
var webpackStream = require('webpack-stream');
44
var webpack = require('webpack');
55
var createWebpackConfig = require('./webpack.base');
6-
7-
var Uglify = require('uglifyjs-webpack-plugin');
8-
var uglifyPlugin = new Uglify();
6+
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
97

108
// entry points for both configs
119
var npmEntry ='./index.js';
@@ -15,36 +13,48 @@ var classicEntry = ['babel-polyfill', npmEntry];
1513
gulp.task('build-lib-sourcemap', ['jsrsasign'], function() {
1614
// run webpack
1715
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
16+
mode: 'development',
1817
entry: npmEntry,
1918
output: {
2019
filename:'oidc-client.js',
2120
libraryTarget:'umd'
2221
},
2322
plugins: [],
2423
devtool:'inline-source-map'
25-
})))
24+
}), webpack))
2625
.pipe(gulp.dest('lib/'));
2726
});
2827

2928
// npm compliant build without source-maps & minified
3029
gulp.task('build-lib-min', ['jsrsasign'], function() {
3130
// run webpack
3231
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
32+
mode: 'production',
3333
entry: npmEntry,
3434
output: {
3535
filename:'oidc-client.min.js',
3636
libraryTarget:'umd',
3737
},
38-
plugins: [uglifyPlugin],
39-
devtool: false
40-
})))
38+
plugins: [],
39+
devtool: false,
40+
optimization: {
41+
minimizer: [
42+
new UglifyJsPlugin({
43+
uglifyOptions: {
44+
keep_fnames: true
45+
}
46+
})
47+
]
48+
}
49+
}), webpack))
4150
.pipe(gulp.dest('lib/'));
4251
});
4352

4453
// classic build with sourcemaps
4554
gulp.task('build-dist-sourcemap', ['jsrsasign'], function() {
4655
// run webpack
4756
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
57+
mode: 'development',
4858
entry: classicEntry,
4959
output: {
5060
filename:'oidc-client.js',
@@ -53,23 +63,33 @@ gulp.task('build-dist-sourcemap', ['jsrsasign'], function() {
5363
},
5464
plugins: [],
5565
devtool:'inline-source-map'
56-
})))
66+
}), webpack))
5767
.pipe(gulp.dest('dist/'));
5868
});
5969

6070
// classic build without sourcemaps & minified
6171
gulp.task('build-dist-min', ['jsrsasign'], function() {
6272
// run webpack
6373
return gulp.src('index.js').pipe(webpackStream(createWebpackConfig({
74+
mode: 'production',
6475
entry: classicEntry,
6576
output: {
6677
filename:'oidc-client.min.js',
6778
libraryTarget:'var',
6879
library:'Oidc'
6980
},
70-
plugins: [uglifyPlugin],
71-
devtool: false
72-
})))
81+
plugins: [],
82+
devtool: false,
83+
optimization: {
84+
minimizer: [
85+
new UglifyJsPlugin({
86+
uglifyOptions: {
87+
keep_fnames: true
88+
}
89+
})
90+
]
91+
}
92+
}), webpack))
7393
.pipe(gulp.dest('dist/'));
7494
});
7595

0 commit comments

Comments
 (0)