From 477af79f705a50b0694eae4e172b22f444e28a0b Mon Sep 17 00:00:00 2001 From: Olivier Tardieu Date: Mon, 13 Jan 2020 13:03:22 -0500 Subject: [PATCH] Add webpackIgnore annotation on dynamic conductor dependencies (#65) --- conductor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conductor.js b/conductor.js index f37d152..80495d9 100644 --- a/conductor.js +++ b/conductor.js @@ -41,7 +41,7 @@ module.exports = { generate } // runtime code function main (composition) { - const openwhisk = require('openwhisk') + const openwhisk = require(/* webpackIgnore: true */ 'openwhisk') let wsk let db const expiration = 86400 // expire redis key after a day @@ -50,11 +50,11 @@ function main (composition) { function done (id) { return `composer/join/${id}` } function createRedisClient (p) { - const client = require('redis').createClient(p.s.redis.uri, p.s.redis.ca ? { tls: { ca: Buffer.from(p.s.redis.ca, 'base64').toString('binary') } } : {}) + const client = require(/* webpackIgnore: true */ 'redis').createClient(p.s.redis.uri, p.s.redis.ca ? { tls: { ca: Buffer.from(p.s.redis.ca, 'base64').toString('binary') } } : {}) const noop = () => { } let handler = noop client.on('error', error => handler(error)) - require('redis-commands').list.forEach(f => { + require(/* webpackIgnore: true */ 'redis-commands').list.forEach(f => { client[`${f}Async`] = function () { let failed = false return new Promise((resolve, reject) => { @@ -100,7 +100,7 @@ function main (composition) { return } const stack = [{ marker: true }].concat(p.s.stack) - const barrierId = require('uuid').v4() + const barrierId = require(/* webpackIgnore: true */ 'uuid').v4() console.log(`barrierId: ${barrierId}, spawning: ${array.length}`) if (!wsk) wsk = openwhisk(p.s.openwhisk) if (!db) db = createRedisClient(p)