forked from cyrus-mc/auth0-logs-to-cloudwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
70 lines (67 loc) · 2.16 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var Path = require('path');
var Request = require('sync-request');
var Webpack = require('webpack');
var _ = require('lodash');
var pkg = require('./package.json');
var WebpackOnBuildPlugin = require('on-build-webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var fs = require('fs');
var LIST_MODULES_URL = 'https://webtask.it.auth0.com/api/run/wt-tehsis-gmail_com-1?key=eyJhbGciOiJIUzI1NiIsImtpZCI6IjIifQ.eyJqdGkiOiJmZGZiOWU2MjQ0YjQ0YWYyYjc2YzAwNGU1NjgwOGIxNCIsImlhdCI6MTQzMDMyNjc4MiwiY2EiOlsiZDQ3ZDNiMzRkMmI3NGEwZDljYzgwOTg3OGQ3MWQ4Y2QiXSwiZGQiOjAsInVybCI6Imh0dHA6Ly90ZWhzaXMuZ2l0aHViLmlvL3dlYnRhc2tpby1jYW5pcmVxdWlyZS90YXNrcy9saXN0X21vZHVsZXMuanMiLCJ0ZW4iOiIvXnd0LXRlaHNpcy1nbWFpbF9jb20tWzAtMV0kLyJ9.MJqAB9mgs57tQTWtRuZRj6NCbzXxZcXCASYGISk3Q6c';
var res = Request('GET', LIST_MODULES_URL);
var modules = JSON.parse(res.getBody()).modules;
module.exports = {
entry: _.set({}, pkg.name, './index.js'),
output: {
path: Path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/build/',
library: true,
libraryTarget: 'commonjs2',
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: {
presets: ['react', 'es2015']
}
},
{
test: /\.json?$/,
loader: 'json'
}
]
},
externals: _(modules).reduce(function (acc, module) {
return _.set(acc, module.name, true);
}, {
// Not provisioned via verquire
'auth0-api-jwt-rsa-validation': true,
'auth0-authz-rules-api': true,
'auth0-oauth2-express': true,
'auth0-sandbox-ext': true,
'detective': true,
'sandboxjs': true,
'webtask-tools': true
}),
plugins: [
new Webpack.optimize.DedupePlugin(),
new Webpack.NoErrorsPlugin(),
new UglifyJSPlugin()
],
resolve: {
modulesDirectories: ['node_modules'],
root: __dirname,
alias: {},
},
node: {
console: false,
global: false,
process: false,
Buffer: false,
__filename: false,
__dirname: false
}
}