entry :頁面中的入口文件。也就是打包從哪個(gè)文件開始。
它有三種類型的值:字符串、數(shù)組、對象
- 字符串:指定從這個(gè)文件路徑下面的文件作為打包的入口文件
- 數(shù)組 : 當(dāng)存在多個(gè)入口時(shí) ,可以使用 Array 的方式,比如依賴第三方庫 bootstrap ,最終 bootstrap 會被追加到打包好的 index.js 中,數(shù)組中的最后一個(gè)會被 export。
- 對象:設(shè)置多個(gè)打包目標(biāo)。每一對鍵值對都對應(yīng)著一個(gè)入口文件。常用語多頁面入口文件配置
1、字符串方法:

字符串

編譯
2、數(shù)組方法:

數(shù)組

編譯
3、對象方法:

對象
output-filename :編譯后輸出的文件名稱
在output-filename的使用中,有三種占位符:
[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.
分別如下圖所示:

name

hash

chunkhash