Skip to content

Conversation

@coyoteecd
Copy link

The concurrency option has an issue when being overridden via CLI, namely it is passed as a string.
Bluebird does not like it and throws the following error:

 TypeError: 'concurrency' must be a number but it is [object String]
      at map (xxx\node_modules\bluebird\js\release\map.js:151:21)
      at Function.Promise.map (xxx\node_modules\bluebird\js\release\map.js:171:12)

Fixed this by adding a Number conversion for it in compile.js. This means one can use it as this:

custom:
  webpack:
    concurrency: ${opt:compile-concurrency, 7}

and then override it as any other serverless option:
serverless package --compile-concurrency 3

@coyoteecd coyoteecd closed this Oct 14, 2020
@coyoteecd coyoteecd reopened this Oct 14, 2020
@vicary vicary merged commit aca80f7 into vicary:serialized-compile Oct 18, 2020
@vicary
Copy link
Owner

vicary commented Oct 18, 2020

@coyoteecd Thanks for the effort!

I'll rebase from upstream from time to time.

My first attempts got errors on tests about package.artifact. Those conflicts requires deep understandings, will find time to dig in the rabbit hole.

@coyoteecd
Copy link
Author

@vicary Do you plan to submit a PR to the main repo with your (and my) changes in this fork? I am using these changes in a project and do not want to fall behind the upstream.

@vicary
Copy link
Owner

vicary commented Nov 19, 2020

@coyoteecd I am 50/50 about submitting PR in this state, because when I rebase from upstream, the conflict is huge. I guess we'll have to at least successfully rebase once before a PR, what do you think?

@coyoteecd
Copy link
Author

coyoteecd commented Nov 20, 2020

Yeah you'd need to rebase first. If you don't want/have time to do it, I can take the code and submit a PR myself; end goal is to get these changes in the main serverless-webpack repo.

@vicary
Copy link
Owner

vicary commented Jan 6, 2021

Weirdly enough, upstream master has missing commits when compared with the fork by takeshape.

Not sure if it was squashed in a PR or something, this rebase was not easy.

Hopefully they'll take this seriously serverless-heaven#680, for the sake of disambiguation the rebased branch is now feat/concurrency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants