Why is webpack --watch not updating when specific files are updated

后端 未结 4 1702
孤街浪徒
孤街浪徒 2020-12-03 13:48

I have a decent sized webpack application that\'s heavily organized into particular segments. Everything works great with both pure javascript and jsx files, as anytime I u

相关标签:
4条回答
  • 2020-12-03 14:29

    I was also stuck with this issue. So I found another solution if any of the above do not work for you. If you use Chrome, you can install an extension called "clear cache" or any other that can clear the cache. Just clear the cache using this extension and then reload the page and you would see the changes. So yes, it may not be the way you want it to work but just an alternate. :)

    0 讨论(0)
  • 2020-12-03 14:29

    I had similar situation but with single file. The problem was that the path of component had letter in different case instead of letters in directory path.

    Directory:

    components/UI/fields/
    

    ERROR: (incorrect case of "F" in "Fields")

    import PrivacyField from 'components/UI/Fields/PrivacyField';
    ...
    

    CORRECT:

    import PrivacyField from 'components/UI/fields/PrivacyField';
    ...
    
    0 讨论(0)
  • 2020-12-03 14:37

    using the old watcher plugin seems to resolve the issue for my needs. Done in my configuration via:

    plugins: [
        new webpack.OldWatchingPlugin()
    ],
    
    0 讨论(0)
  • 2020-12-03 14:38

    I also just came across this issue and it was because the case of the string for the file in the 'require' function call was different than the filesystem. It was still being included in the bundle, but it wasn't being picked up for live re-bundling with webpack-dev-server. Fixing the require call to have the right case fixed it.

    0 讨论(0)
提交回复
热议问题