1 回答

TA貢獻2021條經(jīng)驗 獲得超8個贊
Those HMR chunks are created by HotModuleReplacementPlugin when we use --watch flag running webpack:
webpack -d --watch
The best way I found till now is to define specific folder and file for those chunks. We can do this in the output section, for example:
output: {
path: path.join(root, "dist"),
filename: "bundle.js",
hotUpdateChunkFilename: 'hot/hot-update.js',
hotUpdateMainFilename: 'hot/hot-update.json'
}
After this change, we will have only those two files created. So we can simply add them (or whole folder) to the .gitignore.
I know It's not the best solution, but I didn't found anything better for now.
添加回答
舉報