Created
January 28, 2016 19:02
-
-
Save thebergamo/ddbfea516a282060b0e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Path = require('path'); | |
var Request = require('request-promise'); | |
var Webpack = require('webpack'); | |
var _ = require('lodash'); | |
var LIST_MODULES_URL = 'https://webtask.it.auth0.com/api/run/wt-tehsis-gmail_com-1?key=eyJhbGciOiJIUzI1NiIsImtpZCI6IjIifQ.eyJqdGkiOiJmZGZiOWU2MjQ0YjQ0YWYyYjc2YzAwNGU1NjgwOGIxNCIsImlhdCI6MTQzMDMyNjc4MiwiY2EiOlsiZDQ3ZDNiMzRkMmI3NGEwZDljYzgwOTg3OGQ3MWQ4Y2QiXSwiZGQiOjAsInVybCI6Imh0dHA6Ly90ZWhzaXMuZ2l0aHViLmlvL3dlYnRhc2tpby1jYW5pcmVxdWlyZS90YXNrcy9saXN0X21vZHVsZXMuanMiLCJ0ZW4iOiIvXnd0LXRlaHNpcy1nbWFpbF9jb20tWzAtMV0kLyJ9.MJqAB9mgs57tQTWtRuZRj6NCbzXxZcXCASYGISk3Q6c'; | |
module.exports = Request.get(LIST_MODULES_URL, { json: true }).then(function (data) { | |
var modules = data.modules; | |
return { | |
entry: _.set({}, require('./package.json').name, './main.js'), | |
output: { | |
path: Path.join(__dirname, 'build'), | |
filename: '[name].js', | |
publicPath: '/build/', | |
library: true, | |
libraryTarget: 'commonjs2', | |
}, | |
modules: { | |
loaders: [{ | |
test: __dirname, | |
loader: 'babel-loader' | |
}] | |
}, | |
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(), | |
], | |
resolve: { | |
modulesDirectories: ['node_modules'], | |
root: __dirname, | |
alias: {}, | |
}, | |
node: false, | |
}; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment