webpack hangs at on “95% emit” / “95% emitting”

前端 未结 11 2181
不思量自难忘°
不思量自难忘° 2021-02-05 14:52

This is my production webpack config. The two quotes in the title refer to webpack2 and webpack respectively. Both hang for me with a similar error.

This is my command t

11条回答
  •  悲哀的现实
    2021-02-05 15:18

    This will also happen if you use indexTransform property and the function is throwing an error. To handle this you can wrap your function in a try/catch;

    module.exports = (targetOptions, indexHtml) => {
      try {
        ...
      } catch (error) {
        console.error(error)
        process.exit(1) // Kills webpack
      }
    }
    

提交回复
热议问题