entry :頁面中的入口文件智蝠。也就是打包從哪個文件開始。
它有三種類型的值:字符串奈梳、數(shù)組杈湾、對象
- 字符串:指定從這個文件路徑下面的文件作為打包的入口文件
- 數(shù)組 : 當(dāng)存在多個入口時 ,可以使用 Array 的方式攘须,比如依賴第三方庫 bootstrap 毛秘,最終 bootstrap 會被追加到打包好的 index.js 中,數(shù)組中的最后一個會被 export阻课。
- 對象:設(shè)置多個打包目標(biāo)叫挟。每一對鍵值對都對應(yīng)著一個入口文件。常用語多頁面入口文件配置
1限煞、字符串方法:
2抹恳、數(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.
分別如下圖所示: