Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Support multi-compiler #241

Closed
wants to merge 3 commits into from
Closed

Support multi-compiler #241

wants to merge 3 commits into from

Conversation

lenqwang
Copy link

Support multi-compiler from issue #237

When the poi dev command encounters multiple compilers, there are two solutions

  • Solution A:

If there are more than one compiler, this PR will take the 1st one as the processing object

  • Solution B:

If there are more than one compiler, this PR will terminate and prompt the error message to the user

Now this PR apply Solution A
I don't know how to deal with the more appropriate, please give a feedback

@egoist
Copy link
Owner

egoist commented Sep 26, 2017

In which case the compiler would be a MultiCompiler?

@lenqwang
Copy link
Author

Yeah! If not this PR will do nothing

@egoist
Copy link
Owner

egoist commented Sep 26, 2017

so why do we need this PR? this.compiler always only contains a single compiler

@lenqwang
Copy link
Author

lenqwang commented Sep 26, 2017

As issue #237 When webpack config is return a multi configs

@egoist
Copy link
Owner

egoist commented Sep 26, 2017

@qqcome110 Ah I see

@egoist
Copy link
Owner

egoist commented Sep 27, 2017

Hmm,

If there are more than one compiler, this PR will take the 1st one as the processing object

So why do you return an array of webpack configs in webpack(config) {} in the first place? It only uses the first compiler anyways regarding your PR.

@lenqwang
Copy link
Author

When you run poi dev will do this, But poi build & poi watch will be not

@egoist
Copy link
Owner

egoist commented Sep 27, 2017

they actually should have consistent behavior IMO.

@lenqwang
Copy link
Author

You mean that they are all return 1st one compiler?

@egoist
Copy link
Owner

egoist commented Sep 27, 2017

I don't get it, why do you return multi webpack config and only use the first one.

@lenqwang
Copy link
Author

I get your mean, If return multi webpack config can weigh whether to support multiple servers

@lenqwang
Copy link
Author

@allenfantasy
Copy link

IMO the main problem of this issue would be: currently Poi could not support multi compiler. And the PR just solve this problem, but we need to confirm:

how Poi should deal with multiple compilers in dev mode

And since webpack-dev-server has already support a multiple compiler config (see the comment here which points out that this PR has solved the problems), IMO we should create multiple webpack-dev-server instances but I haven't got time to verify this theory.

cc @qqcome110

@allenfantasy
Copy link

Any ideas about this PR? @egoist

@egoist egoist force-pushed the master branch 4 times, most recently from 08bf8c2 to ff70c50 Compare September 15, 2018 13:59
@egoist egoist force-pushed the master branch 3 times, most recently from 5c96c31 to a5603cb Compare September 20, 2018 15:17
@egoist egoist force-pushed the master branch 2 times, most recently from dbf9be6 to cc6a243 Compare October 27, 2018 10:39
@egoist egoist force-pushed the master branch 4 times, most recently from e527c57 to 1a30e03 Compare December 2, 2018 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants