mariusbalcytis / webpack-bundle

Bundle to Integrate Webpack into Symfony
MIT License
122 stars 36 forks source link

Add support for webpack-dashboard #21

Closed lakhman closed 8 years ago

lakhman commented 8 years ago

Awesome new library here: https://github.com/FormidableLabs/webpack-dashboard

Running the line generated by process via the command line works, but doing it via symfony console command doesn't. It seems to infinitely remain within the while loop waiting for the configuration to dump.

https://github.com/mariusbalcytis/webpack-bundle/blob/master/src/Compiler/WebpackCompiler.php#L106

'node_modules/.bin/webpack-dashboard' '--' 'node_modules/.bin/webpack-dev-server' '--config' '/path/to/app/var/cache/dev/webpack.config.js' '--hot' '--silent' '--no-info' 

This would be awesome to get working, checkout the screenshot on the project page. I want to work for nasa, this is good practice in using their systems.. haha!

Any ideas why the config file is not dumping?

mariusbalcytis commented 8 years ago

Thanks for the link and the idea! Work for NASA? Who doesn't want that! ;)

Currently only in master, I'll tag a release after a day or few with extra features.

lakhman commented 8 years ago

This is awesome! thank you!

When I exit webpack-dashboard (using CTRL+C), sometimes the process is not killed. If you exit the dashboard, then try start it again, you get error message "ADDR IN USE" - it was not killed and is still running in the background (this doesn't happen always).

I use the following to view the process list and kill it manually.

ps aux | grep webpack
# user     10737   0.0  2.1  3435412 354464   ??  Ss    4:28PM   0:24.61 node node_modules/webpack-dev-server/bin/webpack-dev-server.js --config /Sites/app/var/cache/dev/webpack.config.js --hot --silent --no-info --history-api-fallback --inline --display-reasons --progress --colors

# Kill it
kill -9 10737

# Restart (Assuming bin is on your path - PATH="./bin:$PATH")
console m:w:d

I think this is an issue with webpack-dashboard, not this plugin, but if we know the process ID when the user terminates it, can we check and kill it manually?

Other then that, this works great! when compiling it boots the dashboard, then you have to exit it for the compile to complete (else you still get the "manifest file not found error". Not sure how this would work in a CI environment, maybe i'm using an incorrect configuration?


Can you recommend the configuration to use in the yaml file?

    # This works, but is it ideal? - I see a working dashboard "compiling" but requires user input to complete
   # I suspect this config may be causing this issue?
    dev_server:
        arguments:  # What should be recommended for webpack-dashboard?
            - --hot
            - --silent
            - --no-info
            - --history-api-fallback
            - --inline
            - --display-reasons
            - --progress
            - --colors

Awesome stuff! thanks so much! - webpack-dashboard is awesome!! 👍

lakhman commented 8 years ago

Sorry, compiling works, I didn't update this line in my webpack config:

    if (process.env.WEBPACK_MODE === 'watch' && process.env.TTY_MODE === 'on') {
        config.plugins.push(new DashboardPlugin());
    }

This fixed the issue with having to manually exit from dashboard.

lakhman commented 8 years ago

If you're interested, webpack-dashboard uses https://github.com/chjj/blessed to output such nice terminal output.

mariusbalcytis commented 8 years ago

About dev_server arguments:

So, additional option to default ones is no-info. I'd use it with dashboard, as all assets are visible in other panes.

Unfortunately, I cannot reproduce the zombie process case - I've tried several times with different configurations with no success (or, ehm, failure). Seems that dashboard kills the process correctly, at least in my environment.