webpack config

1、entry

  Simple rule: one entry point per HTML page. SPA: one entry point, MPA: multiple entry points.

  webpack config

2、output.filename

  Specifies the name of each output file on disk. You must not specify an absolute path here! The output.path option determines the location on disk the files are written. filename is used solely for naming the individual files.

  single entry

  webpack config

  multiple entries

  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.

  webpack config

 

 

参考:

1、https://webpack.js.org/concepts/output/#options

2、https://webpack.js.org/configuration/entry-context/#entry

相关文章:

  • 2021-11-03
  • 2021-05-28
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-07-24
  • 2021-05-27
  • 2021-04-16
相关资源
相似解决方案