webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

How to use Hot Middleware with git submodules

Open alex-mironov opened this issue 6 years ago • 1 comments

I need to implement HOT reloading of source files which are stored outside /src directory, but on the same level - /shared (this folder actually added as git submodule). What you are reporting:

|__shared
|__src
|__package.json

With current folder structure HOT reload is not working for the code in /shared.

Config includes: webpack

entry: [
  "eventsource-polyfill",
  "webpack-hot-middleware/client?reload=true",
  path.join(process.cwd(), "src/app.js"),
]

.babelrc

    "presets": [
      [
        "latest",
        {
          "es2015": {
            "modules": false
          }
        }
      ],
      "react",
      "stage-0"
    ],
    "plugins": ["react-hot-loader/babel"],

From my understanding, the hot reload should work for /shared folder as well. But it doesn't. What you think should happen: I assume I need to tweak either hot.accept() or module.loaders

alex-mironov avatar Aug 18 '17 06:08 alex-mironov

maybe the code in #237 can help you with it , it uses chokidar package for watching other folders

the-dijkstra avatar Aug 18 '17 10:08 the-dijkstra

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!

alexander-akait avatar Nov 07 '22 20:11 alexander-akait