title: Webpack --watch does not work on Windows (nor webpack-dev-server)
body: <p>It seems to be a common problem, but after a few days of active searching I didn't find any solution that works in my case.</p>
  
  <ul>
  <li>windows7-x64</li>
  <li>node: 6.3.0-x64 (also tried node-v4.4.7-x64)</li>
  <li>npm: 3.10.3</li>
  <li>webpack: 1.13.1</li>
  <li>sublime text (not Vim)</li>
  </ul>
  
  <hr>
  
  <p>First of all, I can't install <strong>fsevents</strong> on windows, which might be the problem, because it's the library for watching on OS X.</p>
  
  <pre><code>D:\file&gt;npm install webpack
  file@1.0.0 D:\file
  `-- webpack@1.13.1
  
  npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
  npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.13
  </code></pre>
  
  <p>So, if your <code>--watch</code> works on windows, please tell me, do you have the same issue with skipping fsevents when installing webpack?</p>
  
  <hr>
  
  <p>Secondly, <code>webpack --watch</code> does compile the file, but it doesn't watch at all.</p>
  
  <p>E.g. if I use stylus watch, then it actually blocks my command line until I press <strong>ctrl+c</strong></p>
  
  <pre><code>D:\file&gt;stylus -w style.styl  
  watching C:/Users/...  
  compiled style.css  
  watching style.styl
  _
  </code></pre>
  
  <p>And only after <strong>ctrl+c</strong> it will unblock my keyboard.</p>
  
  <pre><code>^CTerminate batch job (Y/N)? y
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/FFOXl.jpg">stylus-watch</a></p>
  
  <p>While <code>webpack -w</code> is totally different. It's not just not compiling the file on changes, but it's also not watching at all. I mean that after typing the command <code>webpack --watch</code> it's compiling the file one time, but it doesn't lock my keyboard and so it allows me to write another command.</p>
  
  <pre><code>D:\webpa&gt;webpack main.js bundle.js
  D:\webpa&gt;webpack -w main.js bundle.js
  D:\webpa&gt;webpack --watch main.js bundle.js
  D:\webpa&gt;
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/SbYHU.jpg">webpack-watch</a></p>
  
  <p>The same with <code>webpack-dev-server</code> - it starts server, but then immediately finishes it.</p>
  
  <pre><code>D:\webpa&gt;webpack-dev-server --hot --inline
  http://localhost:8080/
  webpack result is served from /
  content is served from D:\webpa
  D:\webpa&gt;
  </code></pre>
  
  <hr>
  
  <p>It looks like the problem is not with webpack.config.js, because it doesn't watch even with a command like <code>webpack --watch main.js bundle.js</code>, but anyway, here is my basic config.</p>
  
  <pre><code>var webpack = require('webpack');
  module.exports = {
    context: __dirname,
    entry: "./main.js",
    output: {
      path: __dirname,
      filename: "bundle.js"
    },
  };
  </code></pre>
  
  <p>And I've tried many other variants:</p>
  
  <pre><code>var webpack = require('webpack');
  var path = require('path');
  var entry = path.join(__dirname, "main.js");
  var WebpackNotifierPlugin = require('webpack-notifier');
  
  module.exports = {
    context: __dirname,
    entry: entry,
    output: {
      path: __dirname,
      filename: "bundle.js"
    },
    resolve: {root: [__dirname]},
    resolve: { fallback: path.join(__dirname, "node_modules") },
    resolveLoader: { fallback: path.join(__dirname, "node_modules") },
    plugins: [
      new webpack.OldWatchingPlugin(),
      new WebpackNotifierPlugin(),
      new webpack.ResolverPlugin(
          new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
      ),
      new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors/js/applibs.js'),
      new webpack.optimize.DedupePlugin()
    ]
  };
  </code></pre>
  
  <p>As I said, the problem seems to be not in webpack.config.js</p>
  
  <hr>
  
  <p>I've also tried things like:</p>
  
  <pre><code>echo fs.inotify.max_user_watches=524288
  webpack-dev-server --content-base ./ --port 9966 --hot --inline
  webpack --watch --watch-poll
  rename/move/create new folder, reinstall node.js and webpack
  </code></pre>
  
  <p>So yeah, if you had this issue and you <strong>resolved</strong> it, please share some info.</p>
  
  <ul>
  <li>Did you have problems with installing <strong>fsevents</strong>?</li>
  <li>Was your <code>webpack --watch</code> command blocking your keyboard and actually watching, but just not compiling files after changes? Or was it finishing watching immediately like in my case?</li>
  <li>Any other suggestions what to use apart from <code>--watch</code> and <code>webpack-dev-server</code>?</li>
  </ul>
  
  <p>Thanks!</p>