This repository was archived by the owner on Feb 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Handle config function return promise of config object array #84
Merged
pago
merged 4 commits into
trivago:master
from
chenesan:resolve-config-func-return-promise-of-array
Jun 3, 2019
Merged
Handle config function return promise of config object array #84
pago
merged 4 commits into
trivago:master
from
chenesan:resolve-config-func-return-promise-of-array
Jun 3, 2019
Conversation
This file contains hidden or 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
@chenesan Any updates on this? |
I may try to take a look again this week. |
5cae89e
to
72f3733
Compare
72f3733
to
4c39c80
Compare
@pago I just fixed the tests and it's ok to review it :-) You could also test it by manually create a minimal config file which is a function return promise of config array and run /* webpack.config.js */
var path = require('path');
module.exports = () => Promise.resolve([{
entry: './pageA.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'pageA.bundle.js'
}
}, {
entry: './pageB.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'pageB.bundle.js'
}
}]); |
Looks very good to me. Thank you for the time you put into building this feature! @byara could you please also take a look? Then we can proceed with merging and releasing this feature. :) |
Hi @chenesan , I'm sorry I didn't manage to take care of this before my vacation. I'll release it in a moment. |
Released as 2.4.0 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #76 .
I've changed a little how
startFarm
andwebpackWorker
get config and added a test for config function return promise of config object array.After the change, there are some tests get failed. And I'm not sure how to handle them. @pago @efegurkan I need some advices about them:
webpackWorker.spec.js
This two all expect
Promise.reject
will be called when callwebpackWorker
function. Before this change they will be called immediately. But since we have to get the config array after promise resolved,I move the config length checking part into the
then
part, so they will not be called immediately and we cannot check the mock synchronously. I have tried checking calls asynchronously in test (webpackWorker.then(...)
) but it seems thatwebpackWorker
will not finish until jest test time out.index.spec.js
The above three snapshot tests will lose one line
"[WEBPACK] Building 1 target"
since we have to move theconsole.log
into promise(again now we have to resolve config function promise before we know its length). Not sure if it's ok to pass those snapshot tests.