forked from okta/okta-auth-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (37 loc) · 1.11 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* This config builds a minified version that can be imported
* anywhere without any dependencies. It packages the SDK
* with reqwest and Q. It also preserves license comments.
*/
var path = require('path');
var webpack = require('webpack');
var fs = require('fs');
var _ = require('lodash');
var commonConfig = require('./webpack.common.config');
var license = fs.readFileSync('lib/license-header.txt', 'utf8');
module.exports = _.extend(commonConfig, {
entry: './lib/index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'okta-auth-js.min.js',
library: 'OktaAuth',
libraryTarget: 'umd'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true,
comments: function(node, comment) {
// Remove other Okta copyrights
var isLicense = /^!/.test(comment.value);
var isOkta = /.*Okta.*/.test(comment.value);
return isLicense && !isOkta;
}
}),
// Add a single Okta license after removing others
new webpack.BannerPlugin(license)
],
devtool: 'source-map'
});