關於ng build,輸出的檔案修改時間

build產生的assets下的檔案修改時間可以保留原本檔案的修改時間嗎?
目前檔案的修改時間都是打包時的時間。

你可以寫一個小腳本或者 gulp 這樣的東西放在 npm scripts 裏面,每次運行 npm scripts 來打包。腳本先記錄一下檔案的修改時間,build 完成后再恢復或修改成你想要的時間。

1個讚

謝謝 @WittBulter ,我已經寫shell script,分別rsync dist目錄exclude assets 跟 rsync app/assets(原始檔),減少同步到正式環境的資料傳輸。