webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

should rebuild on change

Open WellDone2094 opened this issue 11 years ago • 3 comments

this is my webpack.config.js

var path = require("path");
module.exports = {
    context: __dirname,
    entry: './app/app.js',
    output: {
        path: __dirname + "/dist",
        filename: 'bundle.js'
    },
    module: {
      loaders: [
        { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"}
      ]
    }
}

if i execute webpack --watch everything work and when i modify a file it rebuild, but if i run webpack-dev-server when i change a file it recognize the change and it does something, this is the terminal output

webpack: bundle is now INVALID.
Hash: 0c7ded6cd59f303a190f
Version: webpack 1.12.2
Time: 20ms
chunk    {0} bundle.js (main) 325 bytes
    [0] ./app/app.js 325 bytes {0} [built]
webpack: bundle is now VALID.

but no bundle.js is generated

WellDone2094 avatar Oct 17 '15 17:10 WellDone2094

Are you running the dev server with any arguments?

cristisp avatar Oct 21 '15 13:10 cristisp

webpack-dev-server does not generate files on disk, but keeps them in memory, can be a bit confusing at start, but that is because it is faster.

You need to load the file from the server that webpack-dev-server starts.

kevinsimper avatar Oct 23 '15 21:10 kevinsimper

thanks, i didn't understand that everything was saved in memory and served under the publicPath defined in the webpack configuration.

WellDone2094 avatar Oct 26 '15 14:10 WellDone2094