openwhisk-composer
openwhisk-composer copied to clipboard
with webpack bundle optimization, Composer.compile fails
the terser webpack bundle optimizer by default renames javascript classes. as a result, composer.compile fails with
Invalid argument "task" in "task" combinator
Argument value: m {
'.combinator': [Function: .combinator],
type: 'action',
name: '/_/authenticate',
path: '.test'
}
for now, a workaround is to set keep_classnames: true in the terserOptions passed to the terser webpack plugin constructor.
some extra info: the task interpretation expects these two to yield the same value:
> task.constructor.name
"m"
> Composition.name
"Composition"
i suspect that this is testable outside of webpack, by using the terser npm directly; i think composer already uses it, for the conductor code. so a test would be to apply it to the composer code, as well, and verify that the tests still pass?