Conflict: Multiple assets emit to the same filename

后端 未结 7 1413
耶瑟儿~
耶瑟儿~ 2020-12-13 11:58

I\'m a webpack rookie who wants to learn all about it. I came across a conflict when running my webpack telling me:

ERROR in chunk html [entry] app.js Confl

7条回答
  •  囚心锁ツ
    2020-12-13 12:30

    i'm not quite familiar with your approach so I'll show you a common way to help you out.

    First of all, on your output, you are specifying the filename to app.js which makes sense for me that the output will still be app.js. If you want to make it dynamic, then just use "filename": "[name].js".

    The [name] part will make the filename dynamic for you. That's the purpose of your entry as an object. Each key will be used as a name in replacement of the [name].js.

    And second, you can use the html-webpack-plugin. You don't need to include it as a test.

提交回复
热议问题