Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MultiCompilers #119

Open
Jack89ita opened this issue Feb 19, 2018 · 8 comments
Open

Support for MultiCompilers #119

Jack89ita opened this issue Feb 19, 2018 · 8 comments

Comments

@Jack89ita
Copy link

Hi! As the title says i would like to know if this plugin supports the multicompilers mode of webpack;
I have multiple entries but i can make this plugin works only for one.
Anyone can help me?
Thanks

@stephencookdev
Copy link
Contributor

I imagine this one would require a bit of discussion before implementing. Namely, what would the expected behaviour be when running in multicompiler mode?

Should Jarvis show multiple tabs in its display, each tab showing the output from each compiler?

Or should Jarvis try and average out all of the data for each compiler, as if it's just running through 1 compiler?

For now, as a workaround, if you wanted something closer to the separate tabs route, you could just make multiple Jarvis servers running on different ports, e.g.:

const compiler1Config = {
  plugins: [new Jarvis({ port: 1337 })]
};
const compiler2Config = {
  plugins: [new Jarvis({ port: 1338 })]
};

module.exports = [compiler1Config, compiler2Config]

And then you should a Jarvis server for each compiler, running on http://localhost:1337 and http://localhost:1338

@Jack89ita
Copy link
Author

For my personal use it should be good to open 2 instances on different ports, but when i try to do it as you suggest the second one ovveride the first one.
This is what i'm trying to do:

plugins.push(
  new Jarvis({
    port: 1337
  })
);

pluginsCSS.push(
  new Jarvis({
    port: 1338
  })
);

But only port 1338 works.
Any suggest?

@stephencookdev
Copy link
Contributor

Just double checked, doing 2 server works for me.

Are you sure you're not just having issues with the plugins config in general (e.g. if you keep everything as it is now, but remove the pluginsCSS.push(new Jarvis({ port: 1338 })), does the 1337 server still work?

And when you say 1337 isn't working... what are you seeing exactly? Console errors in the terminal? Console errors in the dashboard? The server crashing?

@Jack89ita
Copy link
Author

Yes, with only one instance of the plugin everything is working fine.
When i use both ports, in port 1338 all is working, but in port 1337 it seems to not even open the connection, in fact the browser can't reach that port.

@stephencookdev
Copy link
Contributor

Is it possible for you to share your whole webpack config? (or a subset of it which still exhibits the same issue)

@Jack89ita
Copy link
Author

Jack89ita commented Feb 28, 2018

Sure, i can share a small subset, hope it will be useful:

let   plugins = [];
let   pluginsCSS = [];

plugins.push(
  new Jarvis({
    port: 1337
  })
);

pluginsCSS.push(
  new Jarvis({
    port: 1338
  })
);

module.exports = [{
  //JS Stuff
  entry: {
    ...
  },
  output: {
    ...
  },
  module: {
    ...
  },
  plugins: plugins
},{
  //CSS Stuff
  entry: {
    ...
  },
  output: {
    ...
  },
  module: {
    ...
  },
  plugins: pluginsCSS
}]

plugins and pluginsCSS are arrays where i store various plugins as Jarvis.

@stephencookdev
Copy link
Contributor

But how are the plugins and pluginsCSS variables instantiated and populated?
It'd be great if you could include a webpack config that we can drag&drop into our workspace, so we can run it locally and reproduce the issue

@Jack89ita
Copy link
Author

I edited the aswer to show you the declarations on the variables e how are populated.
If you still need the webpack config i can send it to you if you explain me how.
Thanks

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

No branches or pull requests

2 participants