0

I have this webpack code. I'm using webpack --watch. For some reason, upon saving a file it works and updates the bundle but sometimes it doesn't without throwing any errors...

'use strict';
let webpack =   require(`webpack`);
module.exports  =   {
    entry: './app.jsx',
    output: {
        path: __dirname + '/dist/js',
        filename: 'app-bundle.js'
    },
    plugins: [
        // new webpack.optimize.UglifyJsPlugin()
    ],
    module: {
        loaders: [
            {
                test: /.jsx?$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                query: {
                    presets: ['es2015', 'react']
                }
            }
        ]
    }
};
Greg Venech
  • 8,062
  • 2
  • 19
  • 29
Paz Lazar
  • 229
  • 5
  • 14
  • Is there a pattern of which files it works for and which it doesn't? The file you save must be imported into your entry module or one of it's children in order for `webpack -w` to pick it up... – Greg Venech Apr 17 '16 at 21:25
  • no there is no pattern. in the some the imported from the root file i save couple of times and after about 3-5 times it stops... – Paz Lazar Apr 17 '16 at 21:38
  • Bizarre... wish I could help you more but it's pretty hard to know what's going on without seeing the issue and no pattern emerging. Check out [this question](http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files/28610124) as it seems you may be running into a similar issue. Maybe try updating your `webpack` package as well. Also I would recommend trying [webpack dev server](http://webpack.github.io/docs/webpack-dev-server.html) which gives you a lot more than `webpack -w`. – Greg Venech Apr 17 '16 at 21:55
  • [This question](http://stackoverflow.com/questions/29292492/why-is-webpack-watch-not-updating-when-specific-files-are-updated) also might help. You should also check the open issues on [github](https://github.com/webpack/webpack/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+watch), just at a glance I already see a few that seem related. – Greg Venech Apr 17 '16 at 22:01

0 Answers0