Skip to content

Commit 34b5bdb

Browse files
committed
feat: prevent mangling of function names
1 parent b49b3ce commit 34b5bdb

File tree

7 files changed

+75
-3070
lines changed

7 files changed

+75
-3070
lines changed

dist/oidc-client.min.js

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

gulpfile.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +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+
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
67

78
// entry points for both configs
89
var npmEntry ='./index.js';
@@ -35,7 +36,16 @@ gulp.task('build-lib-min', ['jsrsasign'], function() {
3536
libraryTarget:'umd',
3637
},
3738
plugins: [],
38-
devtool: false
39+
devtool: false,
40+
optimization: {
41+
minimizer: [
42+
new UglifyJsPlugin({
43+
uglifyOptions: {
44+
keep_fnames: true
45+
}
46+
})
47+
]
48+
}
3949
}), webpack))
4050
.pipe(gulp.dest('lib/'));
4151
});
@@ -69,7 +79,16 @@ gulp.task('build-dist-min', ['jsrsasign'], function() {
6979
library:'Oidc'
7080
},
7181
plugins: [],
72-
devtool: false
82+
devtool: false,
83+
optimization: {
84+
minimizer: [
85+
new UglifyJsPlugin({
86+
uglifyOptions: {
87+
keep_fnames: true
88+
}
89+
})
90+
]
91+
}
7392
}), webpack))
7493
.pipe(gulp.dest('dist/'));
7594
});

lib/oidc-client.js

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

lib/oidc-client.min.js

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

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"gulp-concat": "^2.6.1",
4444
"mocha": "^2.4.5",
4545
"open": "0.0.5",
46+
"uglifyjs-webpack-plugin": "^1.2.7",
4647
"webpack": "^4.12.2",
4748
"webpack-stream": "^4.0.3"
4849
},

webpack.base.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ var createWebpackConfig = function(options) {
2020
]
2121
},
2222
// this is for the sourcemaps
23-
devtool: options.devtool
23+
devtool: options.devtool,
24+
optimization: options.optimization
2425
};
2526
};
2627

0 commit comments

Comments
 (0)