webpack --watch isn't compiling changed files

后端 未结 30 1109
眼角桃花
眼角桃花 2020-12-02 06:00

I tried running webpack --watch and after editing my JS files, it doesn\'t trigger an auto-recompilation.

I\'ve tried reinstalling webpack

30条回答
  •  执念已碎
    2020-12-02 06:29

    Problem was in distiction between .js and .ts files. Why ?

    On project build, Visual Studio compiles typescript files into .js and .js.map. This is totally unecessary, because webpack handles typescript files as well (with awesome-typescript-loader). When editing componet .tsx files in Visual Studio Code or With disabled compileOnSave option in tsconfig.json, edited ts file is not recompiled and my webpack was processing unactual .js file.

    Solution was to disable compiling typescript files in visual studio on project build. Add

    true
    

    in PropertyGroup of your .csproj.

提交回复
热议问题