atroo / hapi-webpack-dev-server-plugin

A plugin for hapijs providing the necessary routes to function as a webpack-dev-server
22 stars 5 forks source link

Conflict with node-dev #4

Closed lfsmoura closed 8 years ago

lfsmoura commented 8 years ago

I use node-dev to reload the server when I make changes on the code. But when I am using hapi-webpack-dev-server-plugin, the server does not reload. It detects that changes were made but it does not restart the server

Here's my configuration:

  const webpack = require('webpack');
  const webpackConf = require('./webpack.config');
  const compiler = webpack(webpackConf);
  plugins.push({
    register: require('hapi-webpack-dev-plugin'),
    options: {
      compiler,
      quiet: false,
      devIndex: '/public',
    },
  });

Maybe there's something you can point me at to solve this.

Thank you for the plugin 👍

de-robat commented 8 years ago

Hello, first of all, glad you like the plugin. I can't reproduce the problem you are describing so i need some more information.

First of all, the hapi-webpack-dev-plugin is purley used for your frontend changes, which means it does not do anything when your server code changes. node-dev in the opposite is supposed to restart your server whenever a file thats been required changes.

So the one thing that most definitley won't work, is changing something in your frontend code that is beeing watched by the webpack-dev-plugin and expecting a server restart. Because the webpack-dev-plugin uses an in-memory filesystem, and node-dev uses the filewatch-api. This means that node-dev most likeley will never see changes that have been made in the weback-dev-plugins in-memory file system. But then again, the whole point of the webpack-dev-plugin is to do these kinds of reloading for you.

So what i'd need next to assist you further would be a minimal project setup with the configs you employ which showcases the problem. I then would gladly analyze it further.

hope that helps at least a little :)

lfsmoura commented 8 years ago

Thank you for the quick reply. I could not reproduce the problem on Ubuntu. This problem occurs only on MacOS. Maybe that is a problem with node-dev and not with hapi-webpack-dev-plugin.

de-robat commented 8 years ago

Ok.Thanks for the feedback!