Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using command

webpack serve --hot --watch --progress OR webpack serve --hot --progress

to start a server.

Webpack Config file

const path = require("path");
module.exports = {
  mode: "production",
  watch: true,
  watchOptions: {
    ignored: ["**/node_modules"],
  },
  entry: "./source/js/index.js",
  output: {
    path: path.resolve(__dirname, "assets/js"),
    filename: "[name].[contenthash].min.js",
    publicPath: "/assets/",
  },
  devServer: {
    contentBase: path.join(__dirname, "assets"),
    compress: true,
  },
  module: {
    rules: [
      {
        test: /.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-env"],
          },
        },
      },
    ],
  },
};

Console

This is the console output I am getting but webpack is not watching for changes. Although it was watching for changes a few days back. P.S : I am new to webpack.

question from:https://stackoverflow.com/questions/66059634/webpack-build-is-working-fine-however-watch-is-not-working

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
168 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...