Giter Club home page Giter Club logo

Comments (8)

kenwheeler avatar kenwheeler commented on May 9, 2024

hmm. thats a tough one. what are the two configs? is there one that you are interested in vs the other?

from webpack-dashboard.

Kmaschta avatar Kmaschta commented on May 9, 2024

Nope, it's two part of the same application and I really want the data of twice apps. (But both are simple webpack config)

What about this?

var config = require('./webpack.config.babel'); // The same file as above with two apps
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');

var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
    // Install dashboard like in the README
});

server.listen(8080);

from webpack-dashboard.

kenwheeler avatar kenwheeler commented on May 9, 2024

Does that work for you?

from webpack-dashboard.

kenwheeler avatar kenwheeler commented on May 9, 2024

You might have to write your own handler function that merges the outputs and then calls setData on the dashboard.

from webpack-dashboard.

Kmaschta avatar Kmaschta commented on May 9, 2024

I'll try this later and let you know! Thanks

from webpack-dashboard.

GGAlanSmithee avatar GGAlanSmithee commented on May 9, 2024

I'm hijacking this issue for a bit, as I have a similar question (tell me if you prefer me to make a separate issue).

I have a setup which is based on the one here.

From package.json two script are run via npm run dev: build:dev, which builds (and watches) the server, and babel-node, which runs the app with HMR.

There are two different webpack config files for these scripts: dev-server and dev-client respectively. I have succesfully added webpack-dashboard to each of these scripts / config files, but the problem is this:

If I npm run build:dev using webpack-dashboard, I cannot see the client (HMR) output.
If I npm run dev using webpack-dashboard, I will see HMR output, but if there's an error in the server code (which is watched by nodemon) it will output the error in the same console, which breaks webpack-dashboard

What I would like to do is to run two npm scripts (one watching the server build using nodemon and another one running the server with HMR) and have both their output in webpack-dashboard, is this possible?

Thanks in advance @kenwheeler et al!

Something like this (psuedo code):

nodemon --exec webpack-dashboard -- webpack --config webpack.config.dev-server.js && webpack-dashboard -- babel-node server/index.js`

from webpack-dashboard.

ryan-roemer avatar ryan-roemer commented on May 9, 2024

Chiming in here -- webpack currently allows (1) a config object (what we're all familiar with) and/or (2) an array of config objects.

@kenwheeler -- Perhaps we should consider some means of detection of other webpack configs from the same originating process id (aka the node webpack you're running at root on the multiple configs).

from webpack-dashboard.

ryan-roemer avatar ryan-roemer commented on May 9, 2024

webpack-dashboard@^2 should handle any webpack config using normal "add a plugin" means.

from webpack-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.