Conflict: Multiple assets emit to the same filename

后端 未结 7 1434
耶瑟儿~
耶瑟儿~ 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 had the same problem, and I found these in the documents.

    If your configuration creates more than a single “chunk” (as with multiple entry points or when using plugins like CommonsChunkPlugin), you should use substitutions to ensure that each file has a unique name.

    • [name] is replaced by the name of the chunk.
    • [hash] is replaced by the hash of the compilation.
    • [chunkhash] is replaced by the hash of the chunk.
     output: {
        path:__dirname+'/dist/js',
    
        //replace filename:'app.js' 
        filename:'[name].js'
    }
    

提交回复
热议问题